添加Apache Server的性能计数器的步骤比较麻烦
添加Apache Server服务器的性能计数器的步骤:
1. Apache上的设置
¨ 转道Apache Installation目录下
¨ 打开 \conf\httpd.conf 进行如下修改:
#
# Allow server status reports,with the URL of http://servername/server-status
# Change the “.your-domain.com” to match your domain to enable.
#
# 取消以下代码前面的只是符号‘#’,并且设置Order(顺序)为允许优先
SetHandler server-status
Order allow, deny
Deny form nothing
Allow from all
¨ 重启Apache服务器,在浏览器中输入 http://server/server-status。如果修改成功,就可以看到Apache运行时的信息。访问http://server/server-status?auto 则可以看到如下信息:
Total Accesses:97
Total kBytes:1732
CPULoad:1.48902
Uptime:44
ReqPerSec:2.89354
BytesPerSec:10190
BytesPerReq:4873.58
BusyWorkers:1
IdleWorkers:9
Scordboard:__W__......
2. LoadRunner上的设置
在左侧树形图中上级Web Server Resource Graphs下的Apache节点,然后在右边对应的窗口中添加Apache所在主机的IP地址,并且加入计数器后单击OK按钮
备注:
这个过程中可能受到如下消息:
Monitor name:Apache. Parsing error, cannot find token: BusyServers. Measurement: BusyServers |192.168.0.186. Hints: 1) Such a measurement does not exist, or the html page may be different form the supported one. 2) Try to replace the Apache.cfg with appropriate Apache_.cfg file in \dat\monitots and rerun the application (entry point: CApacheMeasurement:: NewData). [MsgID:MMSG-47479]
这是由于要监视的Apache版本提供的计数器于LoadRunner默认的计数器不一致造成的,此时可以先关闭Controller,打开Controller的\dat\monitots 目录下的apache.cfg微机,进行如下修改:
¨ 修改Counter0=IdleServer为Counter0=IdleWorkers,同时,修改只是信息Lable0=#Idle server (Apache) 该为 Lable0=#Idle Workers (Apache)
¨ 修改Counter4=BusyServers为Counter4=BusyWorkers,同时修改注释信息,Lable4=#Busy Server(Apache) 为Lable4=#Busy Workers (Apache)