大网数据广告活动
服务器运维问答

Php-Fpm 7 server reached pm.max_children

· 52CE 我爱测

I am receiving this error message when I run an intensive job in Wordpress: [pool www] server reached pm.max_children setting (5), consider raising it Using Php-fpm 7 + Nginx on 2GB RAM Server. When I run: ps aux | grep fpm root …

问题原文

原帖链接 · JoaMika · CC BY-SA 3.0

I am receiving this error message when I run an intensive job in Wordpress:

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

Using Php-fpm 7 + Nginx on 2GB RAM Server.

When I run:

ps aux | grep fpm

root      1508  0.0  1.5 367260 31380 ?        Ss   Nov05   0:11 php-fpm: master process (/etc/php/7.0/fpm/php-fpm.conf)
www-data 10231  0.0  2.7 453420 55540 ?        S    15:10   0:03 php-fpm: pool www
www-data 13266  0.0  2.4 449892 50900 ?        S    22:13   0:00 php-fpm: pool www
www-data 13572  0.0  1.8 372468 37740 ?        S    23:14   0:00 php-fpm: pool www
user+ 13721  0.0  0.0  14512   980 pts/0    R+   23:30   0:00 grep --color=auto fpm

Tried to follow this tutorial to determine correct settings that I need. http://bit.ly/2edUbir

I can't run this command because it's not supported by Php-fpm 7 apparently.

ps -ylC php-fpm --sort:rss

社区高分解答

原帖链接 · Nanhe Kumar · CC BY-SA 3.0

To adjust the settings, you’ll need to find your php-fpm.conf or www.conf depending on what version of PHP-FPM you have installed. In my case, I had to edit /etc/php/7.0/fpm/pool.d/www.conf. You’ll want to look for the following settings and make adjustments based on your server specs:

[php-fpm-pool-settings]
pm = dynamic
pm.max_children = 25
pm.start_servers = 10
pm.min_spare_servers = 5
pm.max_spare_servers = 20
pm.max_requests = 500

To get an idea of what to use for the pm.max_children, you can use this calculation: pm.max_children = Total RAM dedicated to the web server / Max child process size. Remember to leave some RAM for extra services you have running on your system.

Depending on the name of your service, you can try on of the following:

sudo systemctl restart php-fpm

sudo systemctl restart php7.0-fpm

the following command will help us to determine the memory used by each (PHP-FPM) child process:

ps -ylC php-fpm --sort:rss

You can check an average memory usage by single PHP-FPM process with this handy command:

ps --no-headers -o "rss,cmd" -C php-fpm | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }'

For More detail Read Bellow Links Read More 1 Read More 2

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-11-06)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。