How to get “requests per second” for Apache in Lin

2020-05-14 19:03发布

In Windows for ASP, you can get it perfmon, but...

How to get "requests per second" for Apache in Linux?

9条回答
贪生不怕死
2楼-- · 2020-05-14 19:28

I wrote a set of Perl scripts that show the average requests-per-second for the past 1, 5 and 15 minutes (like top). It's at https://gist.github.com/1040144 .

查看更多
虎瘦雄心在
3楼-- · 2020-05-14 19:32

I think mod_status can do it ...

http://httpd.apache.org/docs/2.0/mod/mod_status.html

You can also use zenoss to collect data from mod_status using the community apache plugin.

http://www.zenoss.com/

查看更多
Root(大扎)
4楼-- · 2020-05-14 19:36

To sum up, you can use mod_status and apachetop.

Alternatively, you can use Adam Franco's and Jon Daniel's nice scripts to have a live look.

If you would like to have a look at a partiular date and hour, you can issue this little command:

grep "29/Oct/2014:12" /var/log/apache2/example.com.log | cut -d[ -f2 | cut -d] -f1 | awk -F: '{print $2":"$3}' | sort -nk1 -nk2 | uniq -c | awk '{ if ($1 > 10) print $0}'

Replace with the date and hour you are interested and also with the proper pathfilename of the log file.

It will print out something like:

1913 12:47
 226 12:48
 554 12:49
 918 12:50

There is a nice article here with more options on using a combination of awk, cut and uniq commands to get quick stats of the kind.

查看更多
登录 后发表回答