S
S
smartup2011-02-26 23:06:23
Highload
smartup, 2011-02-26 23:06:23

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

8 answer(s)
D
Dzuba, 2011-02-27
@smartup

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 .

S
SEObomj, 2011-02-26
@SEObomj

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/

S
SergeyGerasimov, 2011-02-26
@SergeyGerasimov

munin-monitoring.org/ was created just for this. Examples of statistics for different sites on the same server: munin.ping.uio.no/

M
merlin-vrn, 2011-02-27
@merlin-vrn

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.

A
akuklev, 2011-02-26
@akuklev

At least in part, these tasks can be solved using Apache2::Profiler .

H
holyorb2, 2011-02-26
@holyorb2

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

S
Sergey, 2011-02-27
@bondbig

Parse server-status output

C
charon, 2011-02-27
@charon

when I worked in the provider's support, then we had different virtual hosts working from different users. And then the load can be calculated by users

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question