Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Nginx php-fpm 502 errors
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Nginx php-fpm 502 errors

djvdorpdjvdorp Member
edited November 2012 in Help

root@host:/# tail /var/log/php5-fpm.log
[04-Nov-2012 22:31:14] NOTICE: fpm is running, pid 2368
[04-Nov-2012 22:31:14] NOTICE: ready to handle connections
[04-Nov-2012 22:31:18] WARNING: [pool www] seems busy (you may need to increase start_servers, or min/max_spare_servers), spawning 8 children, there are 0 idle, and 11 total children
[04-Nov-2012 22:31:19] WARNING: [pool www] seems busy (you may need to increase start_servers, or min/max_spare_servers), spawning 16 children, there are 0 idle, and 14 total children

and

root@host:/# tail /var/log/nginx/error.log
2012/11/04 20:13:35 [alert] 1080#0: accept4() failed (24: Too many open files)
2012/11/04 20:13:35 [alert] 1080#0: accept4() failed (24: Too many open files)
2012/11/04 20:13:35 [alert] 1080#0: accept4() failed (24: Too many open files)
2012/11/04 20:13:35 [alert] 1080#0: accept4() failed (24: Too many open files)
2012/11/04 20:13:35 [alert] 1080#0: accept4() failed (24: Too many open files)
2012/11/04 20:13:35 [alert] 1080#0: accept4() failed (24: Too many open files)
2012/11/04 20:13:35 [alert] 1080#0: accept4() failed (24: Too many open files)
2012/11/04 20:13:35 [alert] 1080#0: accept4() failed (24: Too many open files)
2012/11/04 20:13:35 [alert] 1080#0: accept4() failed (24: Too many open files)
2012/11/04 20:13:35 [alert] 1080#0: accept4() failed (24: Too many open files)

anybody got a quick idea why i am only getting 502 bad gateways from nginx?
clearly it cant reach php-fpm :(

kinda desperate so sorry for the messy post

Comments

  • AmfyAmfy Member
    edited November 2012

    2012/11/04 20:13:35 [alert] 1080#0: accept4() failed (24: Too many open files)

    i.e: ulimit -n 9999

    But definitely weird, since that would mean that there are more than 1000 concurrent connections on nginx

    [04-Nov-2012 22:31:19] WARNING: [pool www] seems busy (you may need to increase start_servers, or min/max_spare_servers), spawning 16 children, there are 0 idle, and 14 total children

    Pretty simple solution by just increasing the count of php-fpm childrens

    By the way: I'm going to bed at 23:00, so if you need some urgent help, try to reach me on IRC

  • Your Linux ulimits are set too low. You'll need to adjust worker_rlimit_nofile, the nginx directive, too.

    Here's a nice tutorial explaining it all to you: http://www.cyberciti.biz/faq/linux-unix-nginx-too-many-open-files/

  • permissions i think,

  • @tinyray Nope, what Amfy and I said :)

    That said, I can't help but wonder /something/ about your post...

  • @Amfy said: i.e: ulimit -n 9999

    But definitely weird, since that would mean that there are more than 1000 concurrent connections on nginx

    Thanks, havent done it yet as that error only occurred at 20:13:35 yesterday and went away after that.

    @Amfy said: Pretty simple solution by just increasing the count of php-fpm childrens

    I did increase that setting, thanks, stupid from me not to think of that.

    @Amfy said: By the way: I'm going to bed at 23:00, so if you need some urgent help, try to reach me on IRC

    I went to sleep after increasing too, will you be on IRC end of the day (after work/school) ?

    @Wintereise said: Your Linux ulimits are set too low. You'll need to adjust worker_rlimit_nofile, the nginx directive, too.

    Here's a nice tutorial explaining it all to you: http://www.cyberciti.biz/faq/linux-unix-nginx-too-many-open-files/

    Thanks for the link and explanation, much appreciated.

Sign In or Register to comment.