WARNING: [pool www] server reached pm.max_children setting (5), consider raising it

Status
Not open for further replies.

rubberducky

Member
Aug 30, 2017
50
7
8
37
A question was posted in IRC, so I'm posting the fix we had here in case anyone else needs it as well. Credit for this fix goes to my team, I had nothing to do with it.

Calculating Pool Size​


If you are seeing warnings that max child pool size has been reached we may want to increase pool size to improve performance.


First we must ensure that there is sufficient free memory when the switch is under load to give to php-fpm.


Once you establish the amount of memory available, check the average size of the current pools


ps -eo size,pid,user,command --sort -size | awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' | grep php-fpm


You may get output like this

Screenshot_from_2021-10-12_01-59-39.png

The average pool size is roughly 7MB, if you have 2GB available then you would calculate 2000 / 7 which would give about 285.


The config file is located in /etc/php/7.3/fpm/pool.d/www.conf


Edit the conf file according and restart php-fpm service


Screenshot_from_2021-10-12_02-05-27.png
 
  • Like
Reactions: DigitalDaz and Dan
Status
Not open for further replies.