1

One of our servers has had much higher than average load today, consistently running higher than normal. Our server admins are making sure all is running okay but this has got me wondering if maybe the server is just very busy today. This in turn has made me think, is there any way to get a reasonably accurate report on how many active website visitors there are across all sites on the whole server?

All sites are PHP/MySQL running on apache 2 on Centos 4.8 - obviously we do have things like google analytics / awstats / webaliser for each site but i just wondered if theres a command that can be run that will give us an active users on server stat? maybe analyse all session files for sessions active in last x minutes?

robjmills
  • 990
  • 8
  • 24

2 Answers2

4

If you enable mod_status in apache, you can get access to a page which will give you statistics on the number of active processes, the number of idle processes, what they are processing, how many accesses per second, and volume.

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

If you use a monitoring framework such as munin (http://munin.projects.linpro.no/), you can query the page over time and store the results. This will give you a graphical display over what the load looks like over time to see if any pikes correlate to the higher load on the box.

emills
  • 774
  • 1
  • 4
  • 15
  • +1 Both mod_status and munin are great suggestions. – EEAA Oct 24 '09 at 14:47
  • I guess I should have also mentioned that munin can monitor the health of the entire system as well (it's plugin based). You can get historical graphs for server load, memory usage, and virtually anything else. This may help further troubleshoot any times with noticably high load. – emills Oct 24 '09 at 14:54
  • interesting that you mentioned mod_status as it reminded me we had enabled this for use with server density http://www.serverdensity.com but never set that up. It provides similar functionality to what you mention with munin. thanks – robjmills Oct 24 '09 at 15:33
2

Another alternative would be to use apachetop. This is an utility like top, which displays Apache information, including requests per second, bytes per second, most popular URLs, etc.

Born To Ride
  • 1,074
  • 6
  • 10