简体   繁体   English

Apache2:“请求/秒”的服务器状态报告值是错误的。 我究竟做错了什么?

[英]Apache2: server-status reported value for “requests/sec” is wrong. What am I doing wrong?

I am running Apache2 on Linux (Ubuntu 9.10). 我在Linux(Ubuntu 9.10)上运行Apache2。

I am trying to monitor the load on my server using mod_status. 我正在尝试使用mod_status监视服务器上的负载。

There are 2 things that puzzle me (see cut-and-paste below): 有两件事让我很困惑(见下面的剪切和粘贴):

  1. The CPU load is reported as a ridiculously small number, 据报告,CPU负载是一个非常小的数字,
    whereas, "uptime" reports a number between 0.05 and 0.15 at the same time. 而“正常运行时间”同时报告0.05到0.15之间的数字。

  2. The "requests/sec" is also ridiculously low (0.06) “请求/秒”也低得离谱(0.06)
    when I know there are at least 10 requests coming in per second right now. 我知道现在每秒至少有10个请求。
    (You can see there are close to a quarter million "accesses" - this sounds right.) (你可以看到有接近25万的“访问” - 这听起来是对的。)

I am wondering whether this is a bug (if so, is there a fix/workaround), 我想知道这是否是一个错误(如果是这样,是否有修复/解决方法),
or maybe a configuration error (but I can't imagine how). 或配置错误(但我无法想象如何)。

Any insights would be appreciated. 任何见解将不胜感激。

-- David Jones - 大卫琼斯

- - - - -
Current Time: Friday, 07-Jan-2011 13:48:09 PST
Restart Time: Thursday, 25-Nov-2010 14:50:59 PST
Parent Server Generation: 0
Server uptime: 42 days 22 hours 57 minutes 10 seconds
Total accesses: 238015 - Total Traffic: 91.5 MB
CPU Usage: u2.15 s1.54 cu0 cs0 - 9.94e-5% CPU load
.0641 requests/sec - 25 B/second - 402 B/request
11 requests currently being processed, 2 idle workers
- - - - -

After I restarted my Apache server, I realized what is going on. 重新启动Apache服务器后,我意识到发生了什么事。 The "requests/sec" is calculated over the lifetime of the server. “请求/秒”是在服务器的整个生命周期内计算的。 So if your Apache server has been running for 3 months, this tells you nothing at all about the current load on your server. 因此,如果您的Apache服务器已运行3个月,这将告诉您关于服务器上当前负载的任何信息。 Instead, reports the total number of requests, divided by the total number of seconds. 而是报告请求总数除以总秒数。

It would be nice if there was a way to see the current load on your server. 如果有一种方法可以查看服务器上的当前负载,那就太好了。 Any ideas? 有任何想法吗?

Anyway, ... answered my own question. 无论如何,...回答了我自己的问题。

-- David Jones - 大卫琼斯

Apache status value "Total Accesses" is total access count since server started, it's delta value of seconds just what we mean "Request per seconds". Apache状态值“总访问次数”是自服务器启动以来的总访问次数,它是秒的增量值,即我们所说的“每秒请求数”。

There is the way: 有方法:
1) Apache monitor script for zabbix 1)zabbix的Apache监视器脚本
https://github.com/lorf/zapache/blob/master/zapache https://github.com/lorf/zapache/blob/master/zapache

2) Install & config zabbix agentd 2)安装并配置zabbix代理
UserParameter=apache.status[*],/bin/bash /path/apache_status.sh $1 $2 UserParameter = apache.status [*],/ bin / bash /path/apache_status.sh $ 1 $ 2

3) Zabbix - Create apache template - Create Monitor item 3)Zabbix - 创建apache模板 - 创建Monitor项
Key: apache.status[{$APACHE_STATUS_URL}, TotalAccesses] 密钥:apache.status [{$ APACHE_STATUS_URL},TotalAccesses]
Type: Numeric(float) 类型:数字(浮点)
Update interval: 20 更新间隔:20
Store value: Delta (speed per second) --this is the key option 存储值:Delta(每秒速度) - 这是关键选项

Zabbix will calculate the increment of the apache request, store delta value, that is "Request per seconds". Zabbix将计算apache请求的增量,存储增量值,即“每秒请求数”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Django中的并发性能(apache2 prefork / mod_wsgi),我做错了什么? - Performance of concurrency in Django (apache2 prefork/mod_wsgi), what am I doing wrong? 如何使我的/ server-status统计信息显示在我的apache2安装中? - How do I get my /server-status stats to display on my apache2 installation? HTTP请求发送到错误的VirtualHost apache2 - HTTP Requests going to wrong VirtualHost apache2 Apache 2 - Mod rewrite 已安装并处于活动状态,但我无法让它工作……我做错了什么? - Apache 2 - Mod rewrite is installed and active but I can't get it to work… what am I doing wrong? 在单个Apache2上运行2个Wordpress实例-怎么了? - Running 2 Wordpress instances on a single Apache2 - what's wrong? apache2 / nginx的Debian Server Pb Remote_Addr错误 - Debian Server Pb Remote_Addr wrong with apache2 / nginx Apache2 WSGI Flask 服务器使用错误的 Python 解释器 - Apache2 WSGI Flask server using wrong Python Interpreter GitLab 站点显示 plesk 默认页面。 我究竟做错了什么? - GitLab site is showing the plesk default page. What am i doing wrong? Apache2:获取错误的根目录 - Apache2: Getting wrong root directories apache2虚拟主机将错误的webroot - apache2 vhost going to wrong webroot
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM