How to increase the pm.max_children setting

Keywords: WordPress + NGINX + SSL - AWS - Technical issue - Other

bnsupport ID: 37c5bba9-01e4-e137-5148-e92dc5e625c6

bndiagnostic output:

? Nginx: Found possible issues
? Wordpress: Found possible issues
? Resources: Found possible issues
https://docs.bitnami.com/installer/infrastructure/nginx/troubleshooting/
https://docs.bitnami.com/installer/faq/linux-faq/administration/increase-memory-linux/

bndiagnostic failure reason: I do not know how to perform the changes explained in the documentation

Description:
Hello,
The website crashes with sudden traffic spike!

I ran the sudo tail -40 /opt/bitnami/php/logs/php-fpm.log and here is the output:

  • [24-Oct-2021 06:37:25] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 5 idle, and 29 total children
  • [24-Oct-2021 06:37:26] WARNING: [pool www] server reached pm.max_children setting (30), consider raising it
  • [24-Oct-2021 20:43:58] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 15 idle, and 29 total children
  • [24-Oct-2021 20:43:59] WARNING: [pool www] server reached pm.max_children setting (30), consider raising it
  • [25-Oct-2021 05:36:31] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 16 idle, and 29 total children
  • [25-Oct-2021 05:36:32] WARNING: [pool www] server reached pm.max_children setting (30), consider raising it
  • [26-Oct-2021 01:01:49] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 14 idle, and 29 total children
  • [26-Oct-2021 01:01:50] WARNING: [pool www] server reached pm.max_children setting (30), consider raising it
  • [26-Oct-2021 14:44:04] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 9 idle, and 29 total children
  • [26-Oct-2021 14:44:05] WARNING: [pool www] server reached pm.max_children setting (30), consider raising it
  • [26-Oct-2021 14:46:06] WARNING: [pool www] server reached pm.max_children setting (30), consider raising it
  • [27-Oct-2021 02:20:09] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 19 idle, and 29 total children
  • [27-Oct-2021 07:10:26] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 11 idle, and 29 total children
  • [27-Oct-2021 07:10:27] WARNING: [pool www] server reached pm.max_children setting (30), consider raising it
  • [28-Oct-2021 06:53:20] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 14 idle, and 29 total children
  • [28-Oct-2021 06:53:21] WARNING: [pool www] server reached pm.max_children setting (30), consider raising it
  • [28-Oct-2021 16:41:23] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 9 idle, and 29 total children
  • [28-Oct-2021 16:41:24] WARNING: [pool www] server reached pm.max_children setting (30), consider raising it
  • [29-Oct-2021 00:00:43] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 16 idle, and 29 total children
  • [29-Oct-2021 00:00:44] WARNING: [pool www] server reached pm.max_children setting (30), consider raising it
  • [29-Oct-2021 13:23:36] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 15 idle, and 29 total children
  • [29-Oct-2021 13:23:37] WARNING: [pool www] server reached pm.max_children setting (30), consider raising it
  • [29-Oct-2021 14:43:48] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 17 idle, and 29 total children
  • [30-Oct-2021 00:31:55] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 18 idle, and 27 total children
  • [30-Oct-2021 00:31:56] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 18 idle, and 29 total children
  • [30-Oct-2021 00:31:57] WARNING: [pool www] server reached pm.max_children setting (30), consider raising it
  • [30-Oct-2021 01:34:27] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 14 idle, and 29 total children
  • [30-Oct-2021 01:34:28] WARNING: [pool www] server reached pm.max_children setting (30), consider raising it
  • [30-Oct-2021 02:35:01] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 19 idle, and 26 total children
  • [30-Oct-2021 15:18:42] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 29 total children
  • [30-Oct-2021 15:18:43] WARNING: [pool www] server reached pm.max_children setting (30), consider raising it

I have already set pm.max_children=60 in the /opt/bitnami/php/etc/memory.conf long back, [Screenshot: https://prnt.sc/1xujcp6] Say like 1-2 months ago,
Still in the recent errors, It still suggests that the value is still 30

Could you please guide me where exactly do it set it to get the thing right?
And also let me know if there are anything else I could do to resolve the crashing?

Thanks in advance!

Hi @vgnavada,

Did you take a look at this guide in our documentation?

https://docs.bitnami.com/aws/apps/wordpress-pro/configuration/configure-phpfpm-processes/

Happy to help!


Was my answer helpful? Click on :heart:

Hi @jota
I followed the settings mentioned here:

  1. I set the pm to ondemand
    image

  2. And in the /opt/bitnami/php/etc/common-ondemand.conf added the following values:
    image

Also restarted all the services, And checked the error log, I got this:
~$ sudo tail -40 /opt/bitnami/php/logs/php-fpm.log

[02-Nov-2021 07:34:01] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 38 idle, and 52 total children

Is something still wrong? Could you please guide me?

Hi @vgnavada,

Just a quick note to let you know we are looking into it.

Hi @vgnavada,

I reviewed the configuration you posted and I think everything is fine. The warning message you see in the log mentions it is spawning new childrens (probably because your website is receiving traffic), but the values are under the limits you configured. Do you continue having issues with your website? Notice you configured the PHP-FPM mode to ondemand, that will fork new processes as needed. You can set it back to dynamic (and restart the PHP-FPM service) if you want to ensure there are some processes running on your server waiting for new customers instead of forking them when they arrive.

Let us know if you have any other questions.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.