Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #200546

Apache and PHP-FPM

From Martin LEUSCH <sce.tech@imereos.fr>
Newsgroups linux.debian.user
Subject Apache and PHP-FPM
Date 2018-09-24 18:00 +0200
Message-ID <wBBrc-7ya-15@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

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?


mpm_worker config:

     StartServers             2
     MinSpareThreads         25
     MaxSpareThreads         75
     ThreadLimit             64
     ThreadsPerChild         25
     MaxRequestWorkers      150
     MaxConnectionsPerChild   0


php-fpm pool config:

pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3


Thanks,

Martin

Back to linux.debian.user | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Apache and PHP-FPM Martin LEUSCH <sce.tech@imereos.fr> - 2018-09-24 18:00 +0200
  Re: Apache and PHP-FPM Nazar Zhuk <nazar@zhuk.online> - 2018-09-24 18:30 +0200

csiph-web