In Ubuntu 9 I am receiving a message on my server that says:
(node) Hit max file limit. Increase "ulimit -n"
However, typing commands in the terminal reveals the following:
$ ulimit
unlimited
$ ulimit -n
65535
And a netstat
reveals I only have ~1000 connections open.
How is it possible I am hitting my limit of 65535 despite netstat
saying I have 1000 active connections? Does anyone see a server config issue I might be overlooking or have tips for debugging further?
ulimit -n
displays the maximum number of open file descriptors, not the maximum number of network connections. You may want to uselsof -p <PID_OF_node.js>
to figure out what files it has open. My guess is that your node.js code has some logic flaws.Typing
ulimit -n
in terminal shows current limit, effective to your current session. If you've changed limit after compaining daemon start, limits for that daemon was not affected. So you'll need to stop/start daemon. But make sure that limits are not chaning in daemon's init script.Also, you might want add something like this:
to /etc/security/limits.conf, so you don't have to
ulimit -n
manually each time.