使用LoadRunner监控Apache的步骤 (转)

一、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就会看到如下信息:


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了。

以下两步跟使用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并添加计数器,这样监视就正常了。

时间: 2024-08-24 22:57:09

使用LoadRunner监控Apache的步骤 (转)的相关文章

LoadRunner 监控 Apache

配置Apache部分 1.修改Apache中Httpd.conf文件 <Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from .localhost </Location> 2.添加ExtendedStatus,设置ExtendedStatus On. 3.取消注释LoadModule status_module modules/mod_status.so

LoadRunner监控Linux

LoadRunner监控Linux rstat协议允许网络上的用户获得同一网络上各机器的性能参数. 需要下载3个包: (1)rsh-0.17-14.i386.rpm (2)rsh-server-0.17-14.i386.rpm (3)rpc.rstatd-4.0.1.tar.gz 一.安装rsh 查看是否安装并卸载rsh [[email protected] /]#  rpm –qa |grep rsh --查看是否安装rsh [[email protected] /]#  rpm –e + 版

LoadRunner监控Linux资源

一.LoadRunner监控Linux资源 (一).准备工作 首先,监视Linux一定要有rstatd这个守护进程,有的Linux版本里也有可能是rpc.rstatd这里只是名字不同而已,功能是一样的. 1.可以通过两种方法验证服务器上是否配置了rstatd守护程序: (1)使用rup命令 它用于报告计算机的各种统计信息,其中就包括rstatd的配置信息.使用命令rup 10.130.61.203,此处10.130.61.203是要监视的linux/Unix服务器的Ip,如果该命令返回相关的统计

监控apache虚拟主机进程

mod_status模块能输出如下内容: 正在伺服请求的工作者(线程或进程)数量 空闲的工作者数量 每个工作者的状态:已完成的请求数.已发送的字节数.(*) 总访问数和已发送的字节总数(*) 服务器自启动/重启以来经过的时间,服务器已经运行的时间. 平均每秒请求数,平均每秒发送的字节数,平均每个请求发送的字节数.(*) 每个工作者的当前CPU使用百分率,以及Apache的当前总计CPU使用百分率.(*) 当前正在被处理的主机和请求(*) 安装步骤 1.检查是否加载mod_status模块 ①进入

LoadRunner监控Linux配置教程

LoadRunner监控Linux资源时弹出如下错误: Monitor name :UNIX Resources. Cannot initialize the monitoring on 192.168.52.189. Error while creating the RPC client. Ensure that the machine can be connected and that it runs the rstat daemon (use rpcinfo utility for thi

云智慧API监控 三个步骤提高业务增长

云智慧API监控 三个步骤提高业务增长 基于互联网.云计算和移动的应用正变得越来越普及,正在改变着人们的生活和工作方式.越来越多的应用服务封装成一系列的API开放出去供第三方使用,这使应用的开发周期和成本大大减少.游戏.支付.找餐馆.找酒店,移动社交.地理位置等在线服务应用都可以通过API数据接口调用的方式快速获取.因此,应用接口数据服务性能的差异会直接关系到你的业务运营质量.它将提高或减少你的业务收入,或使不满意的用户放弃你而选择你的竞争产品. 不要让第三方或后端服务毁了你的应用性能 Twit

教你如何监控 Apache性能

什么是 Apache? Apache是一款 HTTP 服务器软件,现在更名为 "http",而 Apache 则成了一个(包含httpd的项目)巨大的基金组织,根据习惯后文都用 Apache 特指 Apache HTTP Server(httpd).Apache 诞生于1995年,且从 96 年 4 月起就一直是全球最流行的 web 服务器.该项目的定位是一个开源且跨平台(支持类 UNIX 系统和 Windows 系统)的 HTTP 服务器,旨在提供与当前 HTTP 标准同步,安全.高

使用mod_status模块监控apache服务

apache服务可以使用mod_status模块进行监控,该模块在apache配置文件httpd.conf中表示为 LoadModule status_module modules/mod_status.so. 应把前面的#注释掉,来加载该模块. 按G跳转到配置文件的最后,添加 <location /server-status> SetHandler server-status Order Deny,Allow Deny from nothing Allow from all </loc

LoadRunner监控tomcat

LoadRunner监控tomcat (2012-10-25 14:01:42)转载▼ double atof (const char * string);Action(){    // 保存JVM内存数值   web_reg_save_param("JVM_FreeMemory",                       "LB=Free memory: ",                       "RB= MB",