Results 1 to 13 of 13
  1. #1

    Is It Okay To Reload PHP-FPM Most Often?

    Even how high I set the pm.start_servers, or pm.min/max_spare_servers, I always get this error when PHP-FPM reach the limit:

    Code:
    WARNING: [pool web8] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 31 idle, and 62 total children
    I noticed that when I reload php-fpm most often, I never seen this kind of error. This is also supported by this blog.

    My question is if it is okay to reload php-fpm every 9 minutes or whatever interval you set.

  2. #2
    Join Date
    Sep 2012
    Location
    Europe
    Posts
    106
    It is not normal to reload process on the server. Everything should work fine.
    Could you provide us with your server configuration and php-fpm config?
    Also it would be nice to know load average on your server and if you are using some kind of cache on your server (memcached, APC, etc)

  3. #3
    Quote Originally Posted by dynaboot View Post
    It is not normal to reload process on the server. Everything should work fine.
    Could you provide us with your server configuration and php-fpm config?
    Also it would be nice to know load average on your server and if you are using some kind of cache on your server (memcached, APC, etc)
    Here's my php-fpm:

    Code:
    pm.max_children = 256
    pm.start_servers = 40
    pm.min_spare_servers = 40
    pm.max_spare_servers = 192
    pm.max_requests = 500
    Here's my server:

    Code:
    Intel® Xeon® E3-1270 v2 Single Processor - Quad Core Dedicated Server
    CPU Speed: 4 x 3.5 Ghz w/ 8MB Smart Cache
    Motherboard: SuperMicro X9SCM-F
    Total Cores: 4 Cores + 8 Threads
    RAM: 32 GB DDR3 1333 ECC
    Hard Drive: 120GB
    Smart Cache: 8MB
    Here's the output of smem -utk command:

    Code:
    User     Count     Swap      USS      PSS      RSS
    
    web8        51        0   969.1M   999.5M     2.8G
    web6        25        0     1.3G     1.3G     1.6G
    web2       166        0     3.8G     3.8G     9.5G
    root        59   390.3M     9.0G     9.1G     9.2G
    ---------------------------------------------------
               388   391.2M    17.0G    17.2G    26.2G
    web2 php-fpm status page:

    pool: web2
    process manager: dynamic
    start time: 13/Jan/2014:19:22:03 +0800
    start since: 159781
    accepted conn: 322888
    listen queue: 0
    max listen queue: 0
    listen queue len: 0
    idle processes: 165
    active processes: 1
    total processes: 166
    max active processes: 126
    max children reached: 0

    web8 php-fpm status page:

    pool: web8
    process manager: dynamic
    start time: 13/Jan/2014:19:22:03 +0800
    start since: 159779
    accepted conn: 1111067
    listen queue: 0
    max listen queue: 0
    listen queue len: 0
    idle processes: 50
    active processes: 3
    total processes: 53
    max active processes: 28
    max children reached: 0

    Just wondering why I received this error:

    WARNING: [pool web2] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers)
    on my web2 pool. The max_spare_servers value is set to 192. The current value is only 166 but I already received that error.

    And also, what if the max_spare_servers reached to its limit (i.e. 192) what should I do? Just leave it without reloading php-fpm?

    BTW, here's my free -m output:

    Code:
                 total       used       free     shared    buffers     cached
    Mem:         32149      31747        402          0       1082      11394
    -/+ buffers/cache:      19270      12879
    Swap:        32737        534      32203
    I'm already using memcached.

  4. #4
    Help please. I'm already experiencing a 502 Bad Gateway error right now.

    Here's my netstat output:

    Code:
    netstat -an | grep 80 | grep ESTA | wc
       3047   18282  243760

  5. #5
    Join Date
    Sep 2012
    Location
    Europe
    Posts
    106
    Lets try to change your config a bit and reload php-fpm:

    Code:
    pm.max_children = 1024
    pm.start_servers = 148
    pm.min_spare_servers = 40
    pm.max_spare_servers = 256
    pm.max_requests = 0
    Also, is it a global config or this config for each pool?
    Did you perform any system tweaks? e.g open sockets, etc?

  6. #6
    Join Date
    Dec 2011
    Location
    Germany
    Posts
    1,154
    You can also try "pm = dynamic" instead of "pm = static".
    Inbound Marketing & real SEO for web hosting providers
    ✎ Get in touch with me: co<at>infinitnet.de

  7. #7
    Quote Originally Posted by dynaboot View Post
    Lets try to change your config a bit and reload php-fpm:

    Code:
    pm.max_children = 1024
    pm.start_servers = 148
    pm.min_spare_servers = 40
    pm.max_spare_servers = 256
    pm.max_requests = 0
    Also, is it a global config or this config for each pool?
    Did you perform any system tweaks? e.g open sockets, etc?
    This is for one pool only.

    I did not perform any system tweaks. Can you guide me on this?

  8. #8
    Thank you so much dynaboot for helping me. He fixed my server's problem after several hours of hard work. He doesn't even care to ask for money. I don't know how can I say thank you to him.

    I've been to other forums like serverfault asking so many question about 502 bad gateway problem. Only then when dynaboot sends me message privately when he find this thread and even replied honestly above.

    Thank you very much for the help.

  9. #9
    Join Date
    Sep 2012
    Location
    Europe
    Posts
    106

    *

    Quote Originally Posted by jaypabs View Post
    Thank you so much dynaboot for helping me. He fixed my server's problem after several hours of hard work. He doesn't even care to ask for money. I don't know how can I say thank you to him.

    I've been to other forums like serverfault asking so many question about 502 bad gateway problem. Only then when dynaboot sends me message privately when he find this thread and even replied honestly above.

    Thank you very much for the help.
    Thanks for a good word!
    It was a great pleasure to help you with your issue!

  10. #10
    Quote Originally Posted by dynaboot View Post
    Thanks for a good word!
    It was a great pleasure to help you with your issue!
    My website is now experiencing a spike of traffic. And it is doing pretty good.

    I can now confirmed that your configuration on my server is very good.

    Thanks dynaboot.

  11. #11
    Join Date
    Feb 2005
    Location
    UK
    Posts
    553
    Could be useful for others if you shared your solution.

  12. #12
    Quote Originally Posted by Ryan Williams View Post
    Could be useful for others if you shared your solution.
    I am planning to create a blog post on my site. I will update you here once I finish the blog post. It is very effective. We tested a lot of things before dynaboot get the correct configuration.
    Last edited by jaypabs; 01-24-2014 at 10:50 AM.

  13. #13
    Join Date
    Mar 2013
    Posts
    1,294
    Quote Originally Posted by dynaboot View Post
    Thanks for a good word!
    It was a great pleasure to help you with your issue!
    That was nice of you to help him like that
    More people like you on the Internet

Similar Threads

  1. Replies: 8
    Last Post: 07-03-2013, 10:36 AM
  2. Replies: 2
    Last Post: 05-05-2013, 04:33 PM
  3. what is default content of the php-fpm (not php-fpm.conf) file
    By nokia3310 in forum Hosting Security and Technology
    Replies: 2
    Last Post: 12-22-2012, 05:02 PM
  4. Replies: 33
    Last Post: 07-25-2011, 01:01 PM
  5. Need Help: Failed to Compile PHP+PHP-FPM on Amazon FREE EC2
    By klikli in forum Hosting Security and Technology
    Replies: 0
    Last Post: 11-06-2010, 12:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •