Answer the question
In order to leave comments, you need to log in
Why does php7-fpm crash when MariaDB is overloaded?
Good afternoon. There is a server - 2 cores, 8GB of RAM. It has an application in php, DBMS - MariaDB.
So if an evil request arrives in the database, then PHP7.1-fpm refuses service and I get the coveted 502 from nginx. Restarting php-fpm helps. Nothing in the logs, seriously.
For example, it crashes under the following conditions:
CPU: 80%, IO Disk 70%, RAM - 30% free. The system does not go into swap and all other services work fully and responsively.
The database size is 40GB.
Thank you.
Answer the question
In order to leave comments, you need to log in
Maybe max_execution_time is too high and the fpm process pool just ends up on such evil requests? Plus, maybe fpm has a policy with a static pool.
Either the crash occurs because the default idle_timeout parameter is 30 seconds and there are not enough of them, or the FAST CGI child process limit has been exceeded. You can increase the memory_limit and max_execution_time, read_buffer time limits in Maria's config. Not sure if this will help much. It is better to put indexes in the database so that evil queries become kinder and fit into timeouts.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question