Answer the question
In order to leave comments, you need to log in
How to measure the load on a web server (LAMP) generated by each individual site?
Hello. There is a more or less standard LAMP server on Ubuntu Server running a dozen sites.
Each site lives as a separate Apache2 virtual host with a php5 module, Apache runs from a single www-data user. The MySQL database for each site is separate and access to it is made through a separate MySQL user.
Question for experts: how to measure the instantaneous (or for a short period) load created by each site (understand how much memory, processor, and maybe even disk it eats up)?
Answer the question
In order to leave comments, you need to log in
Options:
1. apachetop
2. Put nginx on the frontend, make it write $upstream_response_time to the logs and parse the tail of the log with a small script.
3. Article .
4. Banal way: install mpm-itk, separate sites, giving each its own system user. Contemplate top.
5. For mysql: mytop .
Disable the rest =) Ideally, disable all sites and see how many resources are consumed at idle, and then enable the desired site. It will take about 10 minutes for everything about everything (maybe longer if you want more accurate results). You can also use loadimpact.com/
munin-monitoring.org/ was created just for this. Examples of statistics for different sites on the same server: munin.ping.uio.no/
mpm-itk + acct (built-in accounting) will take into account the load from the webserver and interpreter (if it is mod_*), but will not take into account the load from the database, which in all cases is spinning on behalf of mysql.
If you need to find the culprit, then this option is perfect.
in any way in the form that you wrote
according to the statistics, you need to theoretically find out who can load the server and transfer them to the VPS (as an option to separate the load) and then measure the load from a separate site
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question