使用LoadRunner监控Apache的步骤 (转)
2015-09-23 09:50
671 查看
一、Apache上的设置
打开<Apache Installation>/conf/httpd.conf,进行如下修改:
1、 设置允许查看Apache运行状态的主机
#
# Allow server status reports, with the URL of http://servername/server-status
# Change the ".your-domain.com" to match your domain to enable.
#
#取消一下代码前面的注释符号“#”,并且设置Order(顺序)为允许优先
<Location /server-status>
SetHandler server-status
Order allow,deny
Deny from nothing
Allow from all
</Location>
这样改变以后重新启动Apache在浏览器中输入http://servername/server-status就可以看到Apache运行时的信息,而输入http://servername/server-status?auto就会看到如下信息:
看到这样的信息就表示修改成功,这样就可以使用LoadRunner监视Apache了。
以下两步跟使用LoadRunner监视Apache无关,可以跳过不看。
2、 改变Apache的设置,打开详细状态开关;
#
# ExtendedStatus controls whether Apache will generate "full" status
# information (ExtendedStatus On) or just basic information (ExtendedStatus
# Off) when the "server-status" handler is called. The default is Off.
#
#取消了下面一行前面的注释符号“#”
ExtendedStatus On
3、 有用的设置,查看各模块信息
#
# Allow remote server configuration reports, with the URL of
# http://servername/server-info (requires that mod_info.c be loaded).
# Change the ".example.com" to match your domain to enable.
#
#取消一下代码前面的注释符号“#”,并且设置Order(顺序)为允许优先
<Location /server-info>
SetHandler server-info
Order allow,deny
Deny from nothing
Allow from all
</Location>
二、LoadRunner上的设置
经过以上第一项设置以后就可以使用LoadRunner监控Apache的运行情况了,在LoadRunner可用的监视器中双击Web Server Resource Graphs下的Apache节点,然后在右边对应的窗口中添加Apache所在主机的IP地址,并且加入计数器后单击OK,这样就可以在LoadRunner中实时显示Apache的运行状态信息了。
注意:您可能收到如下消息【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 from the supported one. 2) Try to replace the Apache.cfg with appropriate Apache_<version>.cfg file in <Installation>/dat/monitors and rerun the application (entry point: CApacheMeasurement::NewData). [MsgId: MMSG-47479]】,这是由于要监视Apache的版本提供的计数器与LoadRunner默认的计数器不一致导致的。此时建议先关闭Controller,打开<Installation>/dat/monitors下的apache.cfg文件(其它文件名类似Apache_<version>.cfg的是Apache监视配置的备份,只有apache.cfg是生效的):
1、 修改Counter0=IdleServers为Counter0=IdleWorkers,同时修改注释信息Label0=#Idle Servers (Apache)为Label0=#Idle Workers (Apache),描述信息也建议修改;
2、 修改Counter4=BusyServers为Counter4=BusyWorkers,同时修改注释信息Label4=#Busy Servers (Apache)为Label4=#Busy Workers (Apache) ,描述信息也建议修改。
然后保存并关闭该文件,重新打开Controller并添加计数器,这样监视就正常了。
打开<Apache Installation>/conf/httpd.conf,进行如下修改:
1、 设置允许查看Apache运行状态的主机
#
# Allow server status reports, with the URL of http://servername/server-status
# Change the ".your-domain.com" to match your domain to enable.
#
#取消一下代码前面的注释符号“#”,并且设置Order(顺序)为允许优先
<Location /server-status>
SetHandler server-status
Order allow,deny
Deny from nothing
Allow from all
</Location>
这样改变以后重新启动Apache在浏览器中输入http://servername/server-status就可以看到Apache运行时的信息,而输入http://servername/server-status?auto就会看到如下信息:
Total Accesses: 124 Total kBytes: 444 CPULoad: 3.32432 Uptime: 37 ReqPerSec: 3.35135 BytesPerSec: 12288 BytesPerReq: 3666.58 BusyWorkers: 1 IdleWorkers: 7 Scoreboard: ____W___......................... |
以下两步跟使用LoadRunner监视Apache无关,可以跳过不看。
2、 改变Apache的设置,打开详细状态开关;
#
# ExtendedStatus controls whether Apache will generate "full" status
# information (ExtendedStatus On) or just basic information (ExtendedStatus
# Off) when the "server-status" handler is called. The default is Off.
#
#取消了下面一行前面的注释符号“#”
ExtendedStatus On
3、 有用的设置,查看各模块信息
#
# Allow remote server configuration reports, with the URL of
# http://servername/server-info (requires that mod_info.c be loaded).
# Change the ".example.com" to match your domain to enable.
#
#取消一下代码前面的注释符号“#”,并且设置Order(顺序)为允许优先
<Location /server-info>
SetHandler server-info
Order allow,deny
Deny from nothing
Allow from all
</Location>
二、LoadRunner上的设置
经过以上第一项设置以后就可以使用LoadRunner监控Apache的运行情况了,在LoadRunner可用的监视器中双击Web Server Resource Graphs下的Apache节点,然后在右边对应的窗口中添加Apache所在主机的IP地址,并且加入计数器后单击OK,这样就可以在LoadRunner中实时显示Apache的运行状态信息了。
注意:您可能收到如下消息【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 from the supported one. 2) Try to replace the Apache.cfg with appropriate Apache_<version>.cfg file in <Installation>/dat/monitors and rerun the application (entry point: CApacheMeasurement::NewData). [MsgId: MMSG-47479]】,这是由于要监视Apache的版本提供的计数器与LoadRunner默认的计数器不一致导致的。此时建议先关闭Controller,打开<Installation>/dat/monitors下的apache.cfg文件(其它文件名类似Apache_<version>.cfg的是Apache监视配置的备份,只有apache.cfg是生效的):
1、 修改Counter0=IdleServers为Counter0=IdleWorkers,同时修改注释信息Label0=#Idle Servers (Apache)为Label0=#Idle Workers (Apache),描述信息也建议修改;
2、 修改Counter4=BusyServers为Counter4=BusyWorkers,同时修改注释信息Label4=#Busy Servers (Apache)为Label4=#Busy Workers (Apache) ,描述信息也建议修改。
然后保存并关闭该文件,重新打开Controller并添加计数器,这样监视就正常了。
相关文章推荐
- Datastax文档Apache Cassandra v2.1 第二部分 理解Cassandra架构_数据分发和副本
- APACHE服务实验
- CentOs中Apache开启rewrite模块详解
- apache kafka系列之log4j配置
- apache kafka系列之在zookeeper中存储结构
- CentOS Apache虚拟主机配置
- org.apache.subversion.javahl.ClientException: svn: E155021: This client is too old to work with the
- Apache经常使用配置
- apache搭建
- Apache2.4+php5.6+Mysql5.6+Mantisbt 配置
- apache virtualhost 针对ip开放访问
- apache日志分析
- Datastax文档Apache Cassandra v2.1 第二部分 理解Cassandra架构_节点间通信(Gossip)
- Datastax文档Apache Cassandra v2.1 第二部分 理解Cassandra架构之架构概要
- org.apache.hive.com.esotericsoftware.kryo.kryoexception: encountered unregistered class id 错误解决办法
- Datastax文档Apache Cassandra v2.1 第一部分 关于Apache Cassandra和CQL
- SpringMVC中Shiro报错org.apache.shiro.UnavailableSecurityManagerException: No SecurityManager accessible
- apache中国镜像
- Windows2003安装Apache+php+mysql图文教程
- 在win2003下apache2.2无法加载php5apache2_4.dll