In a Web application with Nginx and PHP-FPM, I've noticed moments of slowness and analyzing the logs, I found this message, which appears from time to time:
[19-Nov-2017 19:24:09] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
After some reseach, I increased the values in the php.ini configuration file, stopped and removed the php container and rebuild it, for the setting set to a file on a volume had effect.
Analyzing the configuration file inside the container, it's with the new values that I set, however, the error message about pm.max_children (5) continues to appear.
Here is my docker-compose.yml
version: '2'
services:
pi_web:
build: ./nginx
ports:
- "80:80"
- "443:443"
volumes:
- ../src:/src
- ./nginx/conf.d:/etc/nginx/conf.d
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- /etc/letsencrypt:/etc/letsencrypt
pi_php:
build: ./php
volumes:
- ../src:/src
- ./php/config/php.ini:/usr/local/etc/php/php.ini
Here is a snippet of the ./php/config/php.ini:
pm = dynamic
pm.max_children = 40
pm.start_servers = 15
pm.min_spare_servers = 15
pm.max_spare_servers = 25
And, if I run:
$ docker exec -it docker_pi_php_1 cat /usr/local/etc/php/php.ini
I see the same values on the snippet above.
The path to the configuration file inside the container is correct, I ran:
$ php --ini
inside the container and the path is in the list of loaded configuration files.
I've fried my brain trying to get around this problem, but so far I haven't succeeded.
Any ideas?