Apache and PHP-FPM
- Date: Mon, 24 Sep 2018 17:52:28 +0200
- From: Martin LEUSCH <sce.tech@xxxxxxxxxx>
- Subject: Apache and PHP-FPM
I have a web server with Apache 2.4 running in worker mode and multiple
php version with FPM service running in dynamic mode.
Sometimes php-fpm stop responding and I got a 503 error on php request
but apache still respond to http request to other files (css, js, jpeg,
...) then after a while apache stop respond (nothing logged on error log
neither in access log). I have to restart apache and php-fpm services to
unlock the server.
Off course it's append while I have malicious activity on the server,
the last time it's happen I found a SQL injection attempt that causing
lot of php error (maybe an infinite loop).
How can I avoid these kind of situation? Can I optimize actual settings?
Should I use mpm_event with apache and/or ondemand process manager with
php-fpm pool config:
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3