Forum: NGINX Handling nginx's too many open files even I have the correct ulimit

Posted by howard chen (Guest)
on 2012-12-19 08:52
(Received via mailing list)
Hi,

On ubuntu, I tried

su - www-data
ulimit -Hn
>> 200000
ulimit -Sn
>> 100000

The value seems be fine as I have worker_connections = 4000, and
worker_processes = 4, so total is 16000, and still within the limit.

But when my server become busy, I can find the error log contains the 
line
entries

"..(24: Too many open files),.."

Any way to debug? Thanks..
Posted by Igor Sysoev (Guest)
on 2012-12-19 09:33
(Received via mailing list)
On Dec 19, 2012, at 11:52 , howard chen wrote:

>
> The value seems be fine as I have worker_connections = 4000, and 
worker_processes = 4, so total is 16000, and still within the limit.
>
> But when my server become busy, I can find the error log contains the line 
entries
>
> "..(24: Too many open files),.."
>
> Any way to debug? Thanks..

What does "cat /proc/sys/fs/file-max" ouuput ?


--
Igor Sysoev
http://nginx.com/support.html
Posted by howard chen (Guest)
on 2012-12-20 04:31
(Received via mailing list)
On Wed, Dec 19, 2012 at 4:32 PM, Igor Sysoev <igor@sysoev.ru> wrote:

> /proc/sys/fs/file-max



cat  /proc/sys/fs/file-max
394959
Posted by 0liver (Guest)
on 2013-05-15 19:12
(Received via mailing list)
I'm facing the same problem here, but I found much lower settings on our
machine (a VPS running Ubuntu 12.04):

# the hard limit of open files
www-data@215247:~$ ulimit -Hn
4096
# the soft limit of open files
www-data@215247:~$ ulimit -Sn
1024
# maximum number of file descriptors enforced on a kernel level
# for more info see: http://serverfault.com/q/122679/88043
root@215247:~# cat /proc/sys/fs/file-max
262144

So I would hope that setting the ulimit values for max open files per 
user
to 262144 (H) and 131072 (S) will help.

But then again, Howard Chen mentioned, that he's facing this problem 
despite
such high values on his system.

Any suggestions?

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,234191,239248#msg-239248
Posted by Jader H. Silva (Guest)
on 2013-05-17 14:46
(Received via mailing list)
Try setting 
worker_rlimit_nofile<http://wiki.nginx.org/CoreModule#worker_rlimit_nofile>



Jader H.



2013/5/15 0liver <nginx-forum@nginx.us>
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.