How to get nginx to see higher limit for file descriptors?

I am currently receiving this warning when nginx is started:
[warn] 902#0: 4096 worker_connections are more than open file
resource limit: 1024

Here is some quick background:

I am running on Fedora 8 core 2.6.x. Originally if I opened a shell and
typed “ulimit -n” it would come back with 1024. If I manually entered
“ulimit -n 65536” and then launched, nginx, the warning would go away.

So I figured I just needed to find a way to set the ulimit system wide
at boot time. After some Google searches I added this to my
/etc/sysctl.conf file:

  • soft nofile 65536
  • hard nofile 65536

Now when I reboot and launch a shell, when I type “ulimit -n” it comes
back properly and shows 65536.

However, when my custom-made init.d script runs from a fresh boot, I
still get a warning from nginx saying the limit is 1024.

So then I added “ulimit -n 65536” to my init.d script just prior to
launching nginx, but this did not make a difference as I still get the
warning. I am launching nginx from the init.d script with a plain old
/path/nginx -c configpath command. I also tried adding “daemon” in front
of it but that didn’t make any difference.

Can someone please let me know what I need to do to the
config/environment so that nginx sees the 65536 available file
descriptors instead of just 1024? Thanks!

  ____________________________________________________________________________________

Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Rt Ibmer ha scritto:

I am currently receiving this warning when nginx is started:
[warn] 902#0: 4096 worker_connections are more than open file resource limit: 1024

From this warning it seems that you are telling Nginx to use 4096
worker processes!! Are you sure?

Can you post your configuration file?

[…]

Manlio P.

Manlio P. <manlio_perillo@…> writes:

From this warning it seems that you are telling Nginx to use 4096
worker processes!! Are you sure?

No, it’s the number of file descriptors allowed for a process; I cannot
imagine
4096 workers (and the swap size!) :wink:

Best regards.

François Battail ha scritto:

Manlio P. <manlio_perillo@…> writes:

From this warning it seems that you are telling Nginx to use 4096
worker processes!! Are you sure?

No, it’s the number of file descriptors allowed for a process; I cannot imagine
4096 workers (and the swap size!) :wink:

Ah, right! :slight_smile:
For some reason I read it as worker_processes instead of
worker_connections…

Best regards.

Regards Manlio P.