Answer the question
In order to leave comments, you need to log in
How to determine what limits the performance of a web server (LAMP)?
There is a server on Amazon EC2 type m1.xlarge (4 cores, 15 GB) with ubunstu server 12.04.
Inside - php, mysql, apache and a php application ( SugarCRM ).
Yandex.Tank is used for load testing .
The server handles 10 requests per second with an average request time of 300ms. As the number of requests per second increases, the following happens.
The average request time starts to grow linearly until 100% of the requests start to fall off on a timeout. At the same time, processes with the sleep status begin to accumulate in mysql.
Limits on the number of Apache processes and the number of mysql connections are not reached, CPU load and memory usage are within 20%.
When replacing the libapache2-mod-php5 + mpm_prefork bundle with php-fpm + mpm_worker, the symptoms persist.
What could be the reason for the appearance of unclosed processes? How to determine why the server is not well?
Answer the question
In order to leave comments, you need to log in
Ubuntu 12.04 + nginx + php-fpm + percona mysql = no problem. In general, why do you need a bad Amazon EC2 for such tasks? Than the same DO does not roll?
Most likely, for some reason, PHP processes do not end (they hang until the timeout).
To try to throw out the Apache? I am considering this option, but I would not like to try at random.
At the moment, it is not clear to me where the congestion is.
DO - rolls, forgot about it.
Watch iostat, do strace for processes, see what shuts up.
Organize monitoring (at least munin and enable more plugins for monitoring both the system itself - disk, memory, processor, interrupts, etc; and apache / mysql / nginx / fpm / etc services) and look at anomalies / correlations on graphs for all modules .
Run synthetic tests (such as unixbench / phoronix) and see where it shuts up.
Most likely, for some reason, PHP processes do not end (they hang until the timeout).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question