Nginx php-fpm 502 bad gateway解决方法



Ubuntu 16.04.2
nginx version: nginx/1.10.3 (Ubuntu)
php-fpm version: php-fpm/5.6


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


eader from upstream, client:, server:, request: “GET /index.php/1/2/test.html HTTP/1.0”, upstream: “fastcgi://unix:/run/php/php5.6-fpm.sock:”, host: “”, referrer: “



定位至配置文件,查找pm.max_children项 (5.6版本在www.conf中)

 pm = dynamic #对于专用服务器,pm可以设置为static。
 #如何控制子进程,选项有static和dynamic。如果选择static,则由pm.max_children指定固定的子进程数。如果选择dynamic,则由下开 参数决定:
pm.max_children #,子进程最大数
pm.start_servers #,启动时的进程数
pm.min_spare_servers #,保证空闲进程数最小值,如果空闲进程小于此值,则创建新的子进程
pm.max_spare_servers #,保证空闲进程数最大值,如果空闲进程大于此值,此进行清理





如果dm设置为 static,那么其实只有pm.max_children这个参数生效。系统会开启设置数量的php-fpm进程。
如果dm设置为 dynamic,那么pm.max_children参数失效,后面3个参数生效。
系统会在php-fpm运行开始 的时候启动pm.start_servers个php-fpm进程,



❤ 喜欢 8059

11条回应:“Nginx php-fpm 502 bad gateway解决方法”

  1. Wow, that’s what I was exploring for, what a material!
    existing here at this webpage, thanks admin of this web site.

  2. I loved as much as you will receive carried out
    right here. The sketch is attractive, your authored subject matter stylish.

    nonetheless, you command get bought an nervousness over that you wish be delivering the following.
    unwell unquestionably come more formerly again as exactly the same nearly
    a lot often inside case you shield this hike.

  3. gamefly说道:

    I think everything posted made a ton of sense.
    However, what about this? suppose you added a little content?

    I mean, I don’t wish to tell you how to run your blog, however what if you added something that grabbed a person’s attention? I mean Nginx php-fpm 502 bad gateway解决方法 is a little vanilla.
    You might peek at Yahoo’s home page and note how they create article titles to
    grab viewers to open the links. You might add a video or a pic
    or two to get readers excited about what you’ve got to say.
    In my opinion, it could make your website a little bit
    more interesting.

  4. I’m gone to tell my little brother, that he should also go to see this weblog on regular basis to obtain updated from
    latest reports.

  5. anch说道:

    Thanks very interesting blog!

  6. Nellie说道:

    Wow, marvelous blog format! How long have you ever been running a blog for?
    you make blogging glance easy. The total look
    of your web site is wonderful, as smartly as the content material!

    dysfunction [Nellie]

  7. Kamagra Kopen说道:

    An impressive share! I have just forwarded this onto a colleague who was conducting
    a little homework on this. And he in fact bought me lunch
    due to the fact that I stumbled upon it for him…
    lol. So let me reword this…. Thank YOU for the meal!!
    But yeah, thanks for spending the time to discuss this issue here on your web page.

    Kamagra Kopen
    [url=]Kamagra pills[/url]

  8. It’s an awesome post in support of all the internet viewers;
    they will obtain benefit from it I am sure.

  9. You really make it seem so easy with your presentation but I find
    this matter to be actually something which I think I would never understand.

    It seems too complex and extremely broad for me. I’m looking forward for your next post, I’ll try to get the hang of it!

  10. Сialis说道:

    You really make it seem really easy along with your presentation however I find
    this matter to be really something which I believe I’d by no means
    understand. It sort of feels too complicated and extremely
    huge for me. I’m looking forward on your subsequent submit, I’ll try to get the
    hold of it!



归档于 Ubuntu