5

I keep getting an error in my node.js instance where it reports the error:

(node) Hit max file limit. Increase "ulimit - n"

Yet when I check my ulimit -n, it says 65535. There is no way in hell my app is opening 65535 connections. Does anyone have any suggestions on what else to check?

Cheers

MPelletier
  • 16,256
  • 15
  • 86
  • 137
kidcapital
  • 51
  • 1
  • 2
  • 3
    posting some code would help. – Richard Schneider Apr 25 '11 at 00:15
  • 1
    are you opening files or connections ? do you close them explicitly, or do you rely on a destructor called by a GC to do it ? do you create them in a loop ? Keep in mind that a GC will close them "later", where "later" can be after 1000 iteration of a loop where you create 100 of them, use them and discard them, so you could have 100000 open file descriptors in a short time if you don't close them when you don't need them anymore. – BatchyX Apr 25 '11 at 07:08
  • try a 'ls -l /proc//fd' with the pid of the process before it dies, then you'll see what file descriptors are open. – linuts Apr 25 '11 at 14:37

1 Answers1

2

You can try to set the limits in /etc/security/limits.conf file. Here is a "how to" guide to set the limits within the file (in your case it should be nofile value).

yojimbo87
  • 65,684
  • 25
  • 123
  • 131