I'm running a linux server with about 60 websites on it that is crashing under heavy load. Is there an easy way to see which Apache virtual host is getting the most traffic?
feedback
|
|
Make sure you have
This will allow you to see all the pages being used load domain within your http server. To access it use http://your_ip/server-status and only the ip defined at Aside from that, like recommended i would use netstat, the server logs and mod_backdoor (serves to get information from an apache that's too sick to respond normally). Taken from the mod_backdoor.txt To compile/install mod_backdoor, perform the following operations:
To enable mod_backdoor, add something like the following to your conf file:
Although the controls below are redundant with the BackdoorAddress shown above, it may be useful as an example. You could specify 0.0.0.0:port for BackdoorAddress then use mod_access directives to control which clients can use the back door.
| ||||
|
feedback
|
|
I've had some good results with wtop / logrep in the past for a box with a single site on it. I don't see any reason why it wouldn't scale to multiple sites, and has support for a url field that could be filtered on. | |||
|
feedback
|
|
Depends on your setup. Does each VirtualHost have its own IP? I would think, probably not, so I'd check into netstat processes to see if there is one IP that it hitting your server that is causing a DDOS of some sort:
| |||
|
feedback
|
|
Parse the apache access log with something like: http://awstats.sourceforge.net/ Or use
| |||
|
feedback
|
|
We recently had our web server being crippled by 220% mysqld CPU spikes. We used mytop to match up the 'spikes' in CPU with the queries being run and narrowed down the culprit site. If mysql is involved then check out the slow query log as well, might help you find the slow queries and then you can use "EXPLAIN" to help you optimise them. | |||
|
feedback
|
|
To add to MikeR's answer recommending wtop / logrep, you could get requests per domain (15 most requested domains):
You can also use
If the above looks potentially helpful, then also checkout "classes". | |||
|
feedback
|