apachetopはリアルタイムでwebサーバーの負荷状況を監視する

 

1.apachetopのインストール
# rpm -ivh http://mirrors.hustunique.com/epel/5/i386/epel-release-5-4.noarch.rpm
# yum install apachetop
2.apachetopの使い方
[root@ip-172-31-27-223 ~]# apachetop -h
ApacheTop v0.12.6 – Usage:
File options:
-f logfile open logfile (assumed common/combined) [/var/log/httpd/access_log]
(repeat option for more than one source)

URL/host/referrer munging options:
-q keep query strings [no]
-l lowercase all URLs [no]
-s num keep num path segments of URL [all]
-p preserve protocol at front of referrers [no]
-r resolve hostnames/IPs into each other [no]

Stats options:
Supply up to one of the following two. default: [-T 30]
-H hits remember stats for this many hits
-T secs remember stats for this many seconds

-d secs refresh delay in seconds [5]

-h this help

Compile Options: -HAVE_KQUEUE -HAVE_FAM -ENABLE_PCRE
Polling Method: stat

3.操作例
/usr/bin/apachetop -f  /var/log/apache/access.log
結果:
last hit: 09:33:24 atop runtime: 0 days, 00:01:00 09:33:25
All: 197 reqs ( 3.3/sec) 1394.5K ( 23.6K/sec) 7248.3B/req
2xx: 137 (69.5%) 3xx: 59 (29.9%) 4xx: 1 ( 0.5%) 5xx: 0 ( 0.0%)
R ( 30s): 61 reqs ( 2.0/sec) 314.8K ( 10.5K/sec) 5285.0B/req
2xx: 60 (98.4%) 3xx: 1 ( 1.6%) 4xx: 0 ( 0.0%) 5xx: 0 ( 0.0%)

REQS REQ/S KB KB/S URL
33 1.10 6.7 0.2*/misc.php
17 0.59 220.7 7.6 /forum.php
1 0.04 10.4 0.4 /forum-298-1.html
1 0.04 11.4 0.4 /thread-56035-1-1.html
1 0.03 8.7 0.3 /thread-317059-1-1.html
1 0.05 9.6 0.5 /thread-277892-1-1.html

Server

Posted by arkgame