duangu8264 2014-10-06 20:56
浏览 1317

警告:[pool www]似乎很忙(您可能需要增加pm.start_servers或pm.min / max_spare_servers)产生

i have a problem with nginx and php-fpm, i searched already in this form but i found no solution for it.

Server: 32 cores 64gb memory

Settings:

nginx.conf:

worker_processes  32;


events {
    worker_connections 2048;
}

in the php-fpm config

pm.max_children = 1500
pm.start_servers = 500
pm.min_spare_servers = 500
pm.max_spare_servers = 500

it work for few minutes, but if we have more users on the server, i got follow errror message:

[06-Oct-2014 15:23: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 483 idle, and 1068 total children

and the page is very slow and a lot of users have the 502 bad gateway message

The load average is about 20 20 20

i tried a lot of differnt settings, but i don't know what is the reason, i hope sombody can help.

Best regards

  • 写回答

4条回答 默认 最新

  • dongliu8542 2014-10-06 21:03
    关注

    You have 32 worker processes which accept up to 2048 connections each (yes, each).

    This means that your nginx accepts up to 65536 simultaneous connections.

    But your PHP-FPM will have at most 1500 instances ready to handle PHP requests.

    Now, depending on your ratio of PHP to static file requests, you are short of available PHP-FPM processes.

    Assuming that the average PHP/static ratio on a typical webpage of yours is 1:5, you could (in theory) serve up to 7,500 parallel requests. All others will get a bad gateway error.

    This is just a theoretical figure, there are many factors to take into account (keep-alive, caching, kernel TCP settings, etc.) to determine the actual maximums, but this should give you an idea where the problem lies.

    评论

报告相同问题?

悬赏问题

  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建