不要追求绝对的公平,红尘之中没有公平而言,人活一世,难得糊涂。                                           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软件测试网U!g'`Vfw+ma
51Testing软件测试网 Sf5G&met(r
一、Apache上的设置
f {n*lA eh051Testing软件测试网aAgH ~-aA
打开<Apache Installation>\conf\httpd.conf,进行如下修改:51Testing软件测试网w;T4A3HD&Ve0y3zL
51Testing软件测试网/Z6v*j C~2N k H
1、  设置允许查看Apache运行状态的主机51Testing软件测试网+l0am"S6w/G.d0X

BY"d*iX)i[:A-[AN0#51Testing软件测试网,Kl0x.FZ)c@f
51Testing软件测试网&}B's$Y|s5[kw,IK pv
# Allow server status reports, with the URL ofhttp://servername/server-status51Testing软件测试网W Fv'Wd&b C5X;f

W a/}3I#t0# Change the ".your-domain.com" to match your domain to enable.
/~QutBKQ'c051Testing软件测试网-v~/K&OYW"y3a*i
#
?&\P[DpBab0N0
|R!U Y$]+u&kr0#取消一下代码前面的注释符号“#”,并且设置Order(顺序)为允许优先51Testing软件测试网7\ KX'E_Z0D&?0k

n)zg7Z U0@ R$WE0<Location /server-status>51Testing软件测试网qx-PNX/PvYC
51Testing软件测试网;UG.jk]\ Dnb
    SetHandler                                  server-status51Testing软件测试网g-`)H8sp&sLE
51Testing软件测试网I@WteM(a
    Order                                        allow,deny
_D|!dYK$N$K$]U^0
~"?d"HnX0    Deny from                                 nothing51Testing软件测试网v D!mv%hL C6a4d/_
51Testing软件测试网 X us0{[6mJ
    Allow from                                all
#}(Y ~H Z+K_Ph0
2Wp*i+R b"Lt b0</Location>
zs?:V }(U:ge051Testing软件测试网RDHB,g#s/]1k}6A
这样改变以后重新启动Apache在浏览器中输入http://servername/server-status就可以看到Apache运行时的信息,而输入http://servername/server-status?auto就会看到如下信息:
*\,w.VI7Vg0
-C4Uj'gv t?0Total Accesses: 124
MKu+i.p0
+]vbaz+r!L0Total kBytes: 444
E|2j/H;i0`?,S;F[0
oIO/wjm0CPULoad: 3.32432
$HH6hH9sB1l0
p?1vLn{s6O|0Uptime: 37
_ g5`CD`*^051Testing软件测试网~#?pk`9D7iZ8?9V(k
ReqPerSec: 3.35135
|0uJK+I%u*m051Testing软件测试网6cB%b'K!LGc,plt
BytesPerSec: 1228851Testing软件测试网6UL2] b4s%Y8WW l

-`c(\{6x$ZJD0BytesPerReq: 3666.58
{Y2wX0a h3Fo0
cs }(^"XR6tC:Q0BusyWorkers: 151Testing软件测试网5l)oX d }h

*E-I5Vx"j0IdleWorkers: 751Testing软件测试网?(P n,ZF/C P0B{

@6R OlbD0Scoreboard: ____W___.........................
/p5g~z ?051Testing软件测试网 Eg*g W#u vn ^%hx$d
51Testing软件测试网wd ])g5g0J f
看到这样的信息就表示修改成功,这样就可以使用LoadRunner监视Apache了。51Testing软件测试网h"j6~:YN.ku|5R
51Testing软件测试网dD8fe4M9Dm2i
以下两步跟使用LoadRunner监视Apache无关,可以跳过不看。
0?y$Q[4a[+Y051Testing软件测试网?0G-JC6H;\_/U a
2、  改变Apache的设置,打开详细状态开关;
SAi]8|/NS%W0
aE:R(lP$jR0#
C%YTI8A$`Y0
't5Jjh1B)lQd K6a0# ExtendedStatus controls whether Apache will generate "full" status
#t6A+v0P)o5Z0
l Q@'hKN8n7m0# information (ExtendedStatus On) or just basic information (ExtendedStatus
_bD6k0Q v Zto051Testing软件测试网,^:eIt m(lg!H
# Off) when the "server-status" handler is called. The default is Off.
)La7fG\.BA5z0
R o(S}x:w;QB0#51Testing软件测试网 e,R2u"Xa RIif#?
51Testing软件测试网j Q)z%BT1b
#取消了下面一行前面的注释符号“#”
2a v8R'QL;Pd0
b,v9eU3w0[0ExtendedStatus On51Testing软件测试网"xH9\b R*q:h;O?

OT F.\R5N,A d03、  有用的设置,查看各模块信息
0k3B,hvA*gU*NZS#L'F051Testing软件测试网6xW&{)O8wA+AC
#51Testing软件测试网zW']Ib@,f4q

|F C.L+u0# Allow remote server configuration reports, with the URL of51Testing软件测试网1e _ \~'q)b$YX/o\+SG(E&w A

M:j]$sB0#  http://servername/server-info(requires that mod_info.c be loaded).
([uO1Uu]9L0
,nj1n'^5V7S0# Change the ".example.com" to match your domain to enable.
6luSIT4k%j051Testing软件测试网+Zx8jF/JC)u#]
#51Testing软件测试网`+~'Z Ba0gu

D4oo6{s1yQ K;n#H0#取消一下代码前面的注释符号“#”,并且设置Order(顺序)为允许优先
N6e`:D8W8p2|-k051Testing软件测试网 v4kt}9F ^
<Location /server-info>51Testing软件测试网&wv%O R"gO GL

R4YI]l0    SetHandler                                  server-info51Testing软件测试网| KfU(f

c k5o_W2{7h0~:M0    Order                                         allow,deny
5k/pB.Sf)?0
${$?$[PJOgb0    Deny from                                  nothing51Testing软件测试网N&]4}$kxlO
51Testing软件测试网!pr9D.HEE
    Allow from                                 all51Testing软件测试网8a6b2W My!@B
51Testing软件测试网w0Q*Ikx6i7N Av.V/b
</Location>
fl f.O1i#EKc051Testing软件测试网 V8bwQH-@ r
二、LoadRunner上的设置51Testing软件测试网W]Y2Hv/aO

*zPR3R7M8@0经过以上第一项设置以后就可以使用LoadRunner监控Apache的运行情况了,在LoadRunner可用的监视器中双击Web Server Resource Graphs下的Apache节点,然后在右边对应的窗口中添加Apache所在主机的IP地址,并且加入计数器后单击OK,这样就可以在 LoadRunner中实时显示Apache的运行状态信息了。
x?,eq7o051Testing软件测试网-w.oTv]3D0L 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 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软件测试网"D!If6t.aF!l3h
51Testing软件测试网3_i*\ R.Pm ^?7|~
1、  修改Counter0=IdleServers为Counter0=IdleWorkers,同时修改注释信息Label0=#Idle Servers (Apache)为Label0=#Idle Workers (Apache),描述信息也建议修改;
2d\LPu:t8~ I051Testing软件测试网Qs:mD"oY
2、  修改Counter4=BusyServers为Counter4=BusyWorkers,同时修改注释信息Label4=#Busy Servers (Apache)为Label4=#Busy Workers (Apache) ,描述信息也建议修改。51Testing软件测试网{h4[/m4k3S i}SG B U

kD#p9_`8a0然后保存并关闭该文件,重新打开Controller并添加计数器,这样监视就正常了。

TAG:

 

评分:0

我来说两句

Open Toolbar