How can Apache be configured so that it will be simple to get server resource stats (CPU, memory) per website (as defined by a separate sites-enabled
entry) and / or by script (each .html
or .php
file in any website)? I had considered setting up individual Apache instances per site, but I do need to keep all the sites on the same IP address as that is a limitation of the web host (no more IP addresses to allocate).
The issue is that the server is quite overloaded (mostly memory). I would like to know which of the websites to move to a different server. By amount of hits, there is less than an order of magnitude between the most-hit site and the least-hit site (including static files such as images). If I could single out a single file or site to move / optimize then that would help.
This is Apache2 running on Ubuntu Server 12.04.