2

I am trying to solve this problem on a VPS Debian based 8GB RAM, 2v Cores, using nginx and php7-fpm.

Checking /var/log/php7.0-fpm.log I have a lot of these warnings:

WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 0 idle, and 7 total children

This is my /etc/php/7.0/fpm/pool.d/www.conf:

pm = dynamic
pm.max_children = 10
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
;pm.process_idle_timeout = 10s;
pm.max_requests = 200

Can anyone help me solve this?

Update:

I have increased the values to:

pm.max_children = 100
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 10
pm.max_requests = 500

In the error log I continue receiving:

[06-Oct-2016 16:35:08] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 4 idle, and 17 total children
J. Scott Elblein
  • 179
  • 1
  • 1
  • 11
Augusto Murri
  • 39
  • 1
  • 3
  • 10

1 Answers1

1

The error becomes when there is a request coming in and PHP-FPM needs to start a new child process to service a request, instead of using an existing one.

This happens because you have really small numbers set in your pool configuration.

The numbers mean that you are allowing a maximum of 10 simultaneous PHP processes running. You are starting with 2 children, and have only 1 minimum server ready to serve requests at any point.

If there is idle time on your web site, PHP-FPM closes any idle processes so that a maximum of 3 processes are online ready to serve requests.

I would multiply:

  • pm.max_children
  • pm.start_servers
  • pm.min_spare_servers
  • ps.max_spare_servers

numbers each by 5, which would be a suitable starting number.

Then you can just monitor your traffic and check if these errors appear again, then adjust numbers accordingly.

J. Scott Elblein
  • 179
  • 1
  • 1
  • 11
Tero Kilkanen
  • 36,796
  • 3
  • 41
  • 63
  • I have increade the values and restarted php7 service but the problem persist – Augusto Murri Oct 06 '16 at 14:43
  • Then you can increase your `start_servers` until you don't get those warnings anymore. They are not a big deal, it just makes your PHP processing a bit slower. – Tero Kilkanen Oct 07 '16 at 00:13
  • i would incraise the max spare sever to i.e. 1000 min spare by 100 and start server by 50 if your load is such extrem – djdomi May 01 '22 at 11:09