使用LoadRunner監控Apache的步驟 (轉)

來源:互聯網
上載者:User

標籤:

一、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並添加計數器,這樣監視就正常了。

使用LoadRunner監控Apache的步驟 (轉)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.