S
S
sameoldmadness2014-01-15 18:21:23
PHP
sameoldmadness, 2014-01-15 18:21:23

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

6 answer(s)
V
Vitaly Zheltyakov, 2014-01-15
@sameoldmadness

See what numbers the xdebug trace shows.

V
Vasily, 2014-01-15
@VasiliyIsaichkin

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?

V
Vasily, 2014-01-15
@VasiliyIsaichkin

Most likely, for some reason, PHP processes do not end (they hang until the timeout).

S
sameoldmadness, 2014-01-15
@sameoldmadness

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.

S
Sergey, 2014-01-15
@bondbig

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.

S
sameoldmadness, 2014-01-15
@sameoldmadness

Most likely, for some reason, PHP processes do not end (they hang until the timeout).

Well, let them hang. As long as there is memory, shouldn't it affect performance?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question