不要追求绝对的公平,红尘之中没有公平而言,人活一世,难得糊涂。                                           it is no use doing what you like, you have got to like what you do.

使用LoadRunner监控Apach服务器的步骤(转)

上一篇 / 下一篇  2007-05-29 16:54:55 / 个人分类:Mercury LoadRunner

使用LoadRunner监控Apach服务器的步骤51Testing软件测试网6C(tx e.m
51Testing软件测试网Ht#}k`Q3V Z
一、Apache上的设置
(D0VQf^kA0
m$|{/HS{&oj0打开<Apache Installation>\conf\httpd.conf,进行如下修改:
5Dj%QWpnDd!m ^0
{dZv/x1z0^FN'w8v1e01、  设置允许查看Apache运行状态的主机51Testing软件测试网TI0\ Vrp
51Testing软件测试网H&M/id9r)w&yY+b
#51Testing软件测试网(~&A2h3T-u7h
51Testing软件测试网[ r.`0i5od,r0a
# Allow server status reports, with the URL ofhttp://servername/server-status51Testing软件测试网4uid|E8\)K;NHAj
51Testing软件测试网5I7[D R0mB4c)Y
# Change the ".your-domain.com" to match your domain to enable.
i;w&L!X"gM0
ZW;I-w(i~LCOH0#51Testing软件测试网'\Q+UZ{!A i UJ

3C/gD._$p.A:SE-~0#取消一下代码前面的注释符号“#”,并且设置Order(顺序)为允许优先51Testing软件测试网 o:J;? z$R@;F:^ DEi-|

7e P)J.YGF0<Location /server-status>
dr8^c3i7d;~6N|b/q0
l%c:sl L7v"\t N'_0    SetHandler                                  server-status
~8M5F*h I;lM+N-\CiF Aj0
(L-?u@f.B2O6q0    Order                                        allow,deny
/IE U&S$fmcp051Testing软件测试网"R,E2A5wA-['}dF-Y:Y}
    Deny from                                 nothing51Testing软件测试网8Mm3rjz-A$a
51Testing软件测试网xKx ?GBs~
    Allow from                                all51Testing软件测试网?Sq*rGG
51Testing软件测试网}dS N|P
</Location>
%b"J.Hb,Lc2cY#XZ0
rk~!g0O%I8})~0这样改变以后重新启动Apache在浏览器中输入http://servername/server-status就可以看到Apache运行时的信息,而输入http://servername/server-status?auto就会看到如下信息:
*q's8|^ ]8x0
J#o"B5T|#k+f&_0Total Accesses: 12451Testing软件测试网#|1G'^*c*jM3Gl
51Testing软件测试网 U,n oxFws&c
Total kBytes: 444
$~Vl)k_/B%S"y051Testing软件测试网x5?:LG;f2J$YOXNJ
CPULoad: 3.3243251Testing软件测试网6W._D4KKJeM&^N(j*mM

n \ PY@\n0Uptime: 3751Testing软件测试网M(TJ pO$H
51Testing软件测试网 | M/F#K nU"}`@#v
ReqPerSec: 3.3513551Testing软件测试网n[0c0B,oQ^

&Z"]v6bCBwy%d0BytesPerSec: 12288
+`WG3}0w&WV5D0
O dojT2e3E"o-K}d7`0BytesPerReq: 3666.58
de#F'}6HrHO0
M9yG8K@^:g0BusyWorkers: 1
V/p/Y c g5x051Testing软件测试网.\j6ct9M+?$Xx&W[c
IdleWorkers: 7
B G#Y2d/D&A\0
rITPB+d3i0Scoreboard: ____W___.........................51Testing软件测试网lEr a3JXfU:z/c
51Testing软件测试网7U#TB2Gc
51Testing软件测试网p8C8`l P&ygl
看到这样的信息就表示修改成功,这样就可以使用LoadRunner监视Apache了。
bJl7c A6G m0
sK}{(vzt/{u:V0以下两步跟使用LoadRunner监视Apache无关,可以跳过不看。
Q"w3n#b#F$AC051Testing软件测试网9EcSN1Ju
2、  改变Apache的设置,打开详细状态开关;
a W F%{` qT[8?0
wQFUu/|`8Z(`0#51Testing软件测试网H'Rj {7\'E9k&D

Ud!Y*kC0h r0# ExtendedStatus controls whether Apache will generate "full" status
*xJw3],N3n'y0
tf?1HC&T2|.{ L0# information (ExtendedStatus On) or just basic information (ExtendedStatus
*R}rT&c051Testing软件测试网 SIvs*DZ~&V&os
# Off) when the "server-status" handler is called. The default is Off.
`o ~`z+Y0
"kat3[fi$k9j0#
qBU8GzH051Testing软件测试网Sxu*[-lf \
#取消了下面一行前面的注释符号“#”
N%rI)J6T%hAk Q051Testing软件测试网%Ar5veF1\q
ExtendedStatus On51Testing软件测试网a"V4v:a_2d G1j
51Testing软件测试网"Lh?4e#V2S%w/Q5G a
3、  有用的设置,查看各模块信息
WC1M9Qo'v0
%]_+n$Q(O^pz0#
sR1n1mo:n4mf0
)C7X*J0A+l5[Q@`E/~0# Allow remote server configuration reports, with the URL of
iit0f!z;|0
*_"k F\$L$W#x0#  http://servername/server-info(requires that mod_info.c be loaded).
Q"MCF{M b/kz0
g6c&R'C G3u0# Change the ".example.com" to match your domain to enable.
,nXh Zk*R4i x OR H051Testing软件测试网q/P!`0~T9q#A \p]
#51Testing软件测试网 MV2bC L z#c

%N:BrH0w5C*q0#取消一下代码前面的注释符号“#”,并且设置Order(顺序)为允许优先
-C%Ig"j2LM2v051Testing软件测试网*f)Do"E;^ gj
<Location /server-info>
.SQI1hWI9^0
&h6T zy/Y1?y%S8mt0    SetHandler                                  server-info
o?4bGO"Y:p^0
y;[7_6C~T0    Order                                         allow,deny
9\G#D7w3~K0
7^'l0g ~'y7C4r1w0    Deny from                                  nothing
4rv yd!ybuhUl051Testing软件测试网#wKG5w E w!} ~ C
    Allow from                                 all
g [S&H(kx@051Testing软件测试网{3dq nE.n3hu
</Location>
|o}$X#A`7G0
5Bp0k'd$dC0二、LoadRunner上的设置51Testing软件测试网_wLC4~-D3Bw/X s
51Testing软件测试网ivm|+DGap
经过以上第一项设置以后就可以使用LoadRunner监控Apache的运行情况了,在LoadRunner可用的监视器中双击Web Server Resource Graphs下的Apache节点,然后在右边对应的窗口中添加Apache所在主机的IP地址,并且加入计数器后单击OK,这样就可以在 LoadRunner中实时显示Apache的运行状态信息了。
^2Y4n,mW&N{A051Testing软件测试网-a T(cnV
注意:您可能收到如下消息【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是生效的):51Testing软件测试网S@`7jy;b#}"XN0z

] jfaK01、  修改Counter0=IdleServers为Counter0=IdleWorkers,同时修改注释信息Label0=#Idle Servers (Apache)为Label0=#Idle Workers (Apache),描述信息也建议修改;51Testing软件测试网4X-kHj,D|-]7^
51Testing软件测试网,F2m~u1f!m\ i
2、  修改Counter4=BusyServers为Counter4=BusyWorkers,同时修改注释信息Label4=#Busy Servers (Apache)为Label4=#Busy Workers (Apache) ,描述信息也建议修改。
7D*Fn\G5Bg#vX0
|iKun1^x o!{4g*U"M0然后保存并关闭该文件,重新打开Controller并添加计数器,这样监视就正常了。

TAG:

 

评分:0

我来说两句

Open Toolbar