i know there are a lot of good answers for questions like this on stackoverflow or serverfault but i cant find answers for my questions.
I have following /status
output for my php-fpm 7.0 processes.
pool: www
process manager: dynamic
start time: 04/Jul/2017:15:09:20 +0200
start since: 609
accepted conn: 6113
listen queue: 0
max listen queue: 0
listen queue len: 0
idle processes: 89
active processes: 11
total processes: 100
max active processes: 27
max children reached: 0
slow requests: 0
As you can see i have a lot of idle processes waiting to get something to do. Are idle processes good or bad practice?
; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
; This value sets the limit on the number of simultaneous requests that will be
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
; CGI. The below defaults are based on a server without much resources. Don't
; forget to tweak pm.* to fit your needs.
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
; Note: This value is mandatory.
pm.max_children = 550
; The number of child processes created on startup.
; Note: Used only when pm is set to 'dynamic'
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
pm.start_servers = 100
; The desired minimum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.min_spare_servers = 50
; The desired maximum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.max_spare_servers = 150
; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to 'ondemand'
; Default Value: 10s
pm.process_idle_timeout = 10s;
; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
I try to find the perfect configuration for our server because something is leaking our memory. Day after day php is using more and more memory until the server stops working.
If i look at the /status
ouput i think that my values defined in www.conf
are too high. Am i right? There are only 27 processes active (max) i and have over 80 processes waiting. Isn´t that bad?
Thank you for helping!