php fpm ondemand vs dynamic vs static
php fpm ondemand configuration and settings
The php dynamic Pool Problem (idle process)
pool: www process manager: dynamic start time: 04/Aug/2021:04:28:47 +0000 start since: 470621 accepted conn: 205650 listen queue: 0 max listen queue: 3 listen queue len: 65536 idle processes: 48 active processes: 2 total processes: 50 max active processes: 46 max children reached: 0 slow requests: 0
php fpm ondemand vs dynamic memory problem
Setting
|
Value
|
max_children
|
100
|
start_servers
|
32
|
min_spare_servers
|
16
|
max_spare_servers
|
32
|
max 100*40=4000MB 4GB average
100*128MB(max) = 12800MB 12GB max
max children to>> max spare servers, max_spare servers to >> min_spare_servers (
when will php dynamic pool reaches max_spare servers to min_spare_servers?
php dynamic pool problem www busy process restarting bye
when max spare servers reaches this message appears and the php fpm will restart. but there is a variable pm.max children still not reacched
and the emergency restart threshold also not enabled.
php fpm restarts when it busy
WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 6 idle, and 140 total children
Case 2:WARNING: [pool www] server reached pm.max_children setting (150), consider raising it
in case2 restart is ok, but why process existing bye bye in pool www busy situation.
php fpm ondemand hassle free but some low performance
php fpm dynamic configuration formula but not a rule
Setting
|
Value
|
max_children
|
100
|
start_servers
|
32
|
min_spare_servers
|
16
|
max_spare_servers
|
32
|
php fpm pm = static
When Should use Php fpm Static
There is a constant traffic >> always below to the 100 or 1000 child processes.
Memory = average and php max memory limit
Dig: How php fpm dynamically allocated php fpm processes
Php memory high memory usage problem with dynamic or static
php max memory limit: 256MB in php.ini
Average memory limit: 50MB but it may go upto 256MB.
start servers+ idle server = 30process
30*50=1500MB in idle mode in dynamic
30*256=7680MB possible usage in attack mode or other cases.
> try opcache to store php files in memory.
service php7.0-fpm reload