如何衡量服务器利用率?
假设服务器的最大容量已知(例如,每小时 1000 个请求),如何以每单位时间的请求(假设一小时)来衡量服务器利用率? 我知道等式是:
utilization = Number of executed requests by server / server capacity
但是如何测量从客户端发送到服务器的请求? 我需要一个有效的方程式来定义请求。
How can I measure the server utilization in terms of requests per unit of time (lets say one hour), assuming the server's maximum capacity is known (for example, 1000 requests per hour)?
I know the equation will be:
utilization = Number of executed requests by server / server capacity
But how can I measure the requests sent from a client to a server?
I need a valid equation to define a request please.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这无法回答,因为在不知道协议的情况下无法识别客户端/服务器模型中的“请求”。为了说明这一点,可以在一个连接中发送多个 HTTP 请求。基于 UDP 的协议根本不使用连接。
我能想到的在未识别的客户端/服务器协议中定义请求的最一般描述是客户端发起的需要服务器响应的消息的数量。它是一个观察变量,而不是导数。
在程序中,您可以通过对相关服务器的回调或 RPC 或能够通过检查日志文件提供此变量的程序来获取此变量。
This cannot be answered as "request" in a client/server model cannot be identified without knowing the protocol. To illustrate, multiple HTTP requests can be sent in one connection. UDP based protocols do not use connections at all.
Most general description I can come up with to define a request in an unidentified client/server protocol is the number of messages initiated by the client that require a response by the server. It is a observed variable, not a derivative.
In a program you would obtain this variable via a callback or RPC to the server in question or a program that would be able to provide this variable by inspecting logfiles.
为了使用,您可以从“sar”实用程序中获得所需的一切。
然而,“请求”将非常特定于您正在运行的软件。例如,如果您正在运行 Apache Web 服务器,默认情况下,它将记录每个请求,您可以扫描这些日志以提取请求数据。
但请注意,这些是“技术”请求,可能不符合您的用户对请求的想法。想想亚马逊,我可能会将我的图书订单视为一个“请求”,亚马逊服务器会将其记录为 50 个左右的 http 请求。
For utilisation you can get all you need from the "sar" utility.
However "request" will be very specific to the software you are running. For instance if you are running Apache web server, by default, it will log each request and you can scan these logs to extract you request data.
However be aware that these are "technical" requests and may not conform to your users idea of a request. Think Amazon, I may think of my book order as one "request", Amazons server will log this as 50 or so http requests.