Apache 日志文件每秒的请求数?
是否可以从 Apache 日志文件确定每秒请求数的指标?如果是这样,该怎么办呢?
干杯, 卡塔尔。
Is it possible to determine a metric for requests per second from Apache log files? If so, how does one go about this?
cheers,
Cathal.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须解析 访问日志 中的条目才能查看请求每秒。
通用日志格式如下所示:
您可以使用 Java 或其他某种强文本解析语言来查找“GET”访问日志中的条目,然后通过对日期/时间部分进行分组来“总结”每秒的请求数(“2000 年 10 月 10 日:13:55:36”)。那些在日期/时间部分匹配的“GET”条目将包含在每秒请求数部分中。
从那里,您可以收集有关一天中特定时间、每秒最大请求数等的更多指标...
编辑
看起来 SOF 上也已经提出了这个问题: 如何在 Linux 中获取 Apache 的“每秒请求数”?
You would have to parse out entries in your Access Log to view requests per second.
The Common Log Format looks something like this:
You could use Java or some other sort of strong text parsing language to find "GET" entries in the Access Log and then "sum up" the number of requests per second by grouping the date/time portions ("10/Oct/2000:13:55:36"). Those "GET" entries that match in their date/time portion would be included in the requests per second portion.
From there, you could gather further metrics about particular times of the day, maximum requests per second, etc...
Edit
Looks like this has already been asked as well on SOF: How to get “requests per second” for Apache in Linux?