Too many open files

how to handle?

2009/09/10 10:09:30 [alert] 9691#0: accept() failed (24: Too many open
files)

i would start with google, look up the “how to ask smart questions”

and if you founded it and read it come back to the list.

but from the level of details you gave i presume you are a newbie linux
administrator and founded the 1024 limitation in linux.

to get over it modify the limits.conf in /etc/security/ and I presume
you
are using ubuntu so modify the /etc/pam.d/login and include the
pam_limits.so with full path

:slight_smile:

Yes, newbie to linux (a year into it, still learning every day).
I searched on Google but am unclear on server settings that impact this
vs.
nginx settings and what the numbers should be, etc.

put a ulimit -n 65000 or something like that in /etc/sysconfig/nginx or
depending on the distro into the nginx init script

greets

Hello!

On Thu, Sep 10, 2009 at 11:10:28AM -0400, Ilan B. wrote:

how to handle?

2009/09/10 10:09:30 [alert] 9691#0: accept() failed (24: Too many open
files)

You have to tune your OS. Under FreeBSD:

sysctl kern.maxfiles=65535
sysctl kern.maxfilesperproc=60000

and then either restart nginx or reconfigure it with
worker_rlimit_nofile set in config.

Under Linux it should be something like:

echo 65535 > /proc/sys/fs/file-max

(never tested).

Consult your OS docs for instructions how to make this changes
permanent (usually you have to add them into /etc/sysctl.conf).

Maxim D.

heh, this is not the best way to do that

i have seen guys are puting this to the www-data .bashrc because they
dont
know about limits.conf

he has the pre process problem not the general limit i guess :slight_smile:

On Thu, Sep 10, 2009 at 11:16 AM, István [email protected] wrote:

i would start with google, look up the “how to ask smart questions”

This was totally unnecessary and rude. If you do not want to help that’s
fine but there is no need to humiliate.

:slight_smile:


the sun shines for all

Jim

as i didn’t help this is really a huge problem

please note, do NOT overwrite but ADD

add to /etc/security/limits.conf

www-data soft nofile 24000
www-data hard nofile 32000

add /etc/pam.d/login

session required /lib/security/pam_limits.so

That isn’t the point and you know it. But in case you don’t I’ll make it
simple for you. Help or don’t help but either way you don’t need to be
an arrogant ass.

Sent from my Verizon Wireless BlackBerry

I found the solution for the same problem on my environment, ( Solaris
10 ) here:

http://www.cyberciti.biz/faq/linux-unix-nginx-too-many-open-files/

Quoting:

"Then open the nginx configuration file (default: /etc/nginx/nginx.conf)
and the following line right after the “worker_processes” entry
line

worker_rlimit_nofile 20480;

Once both changes are made, run the Nginx lint to make sure no errors
have been introduced:

# nginx -t
2010/11/01 17:07:46 [info] 9520#0: the configuration file

/etc/nginx/nginx.conf syntax is ok
2010/11/01 17:07:46 [info] 9520#0: the configuration file
/etc/nginx/nginx.conf was tested successfully

and then restart Nginx"

Thank to them I solved my problem :slight_smile:
hope this helps…

Posted at Nginx Forum: