I am running into this error on an Ubuntu Machine while performing a GET operation in the Request module and writing to a MongoHQ store.
My error is this:
{ [Error: connect EMFILE]
stack: 'Error: connect EMFILE\n at exports._errnoException (util.js:682:11)\n at connect (net.js:813:19)\n at net.js:897:9\n at Object.asyncCallback [as callback] (dns.js:78:16)\n at Object.onlookup [as oncomplete] (dns.js:94:10)',
code: 'EMFILE',
errno: 'EMFILE',
syscall: 'connect' }
I have seen this solution:
How do I change the number of open files limit in Linux?
And I followed the prescribed solution by modifying my ulimit values so that my output of ulimit -a is:
4096
I also changed my limits.conf file from this link:
https://askubuntu.com/questions/162229/how-do-i-increase-the-open-files-limit-for-a-non-root-user
I added these lines:
- soft nofile 4096
- hard nofile 4096
and I still have the same issue.
However I do have another ubuntu box with less memory and storage running (also) on an Amazon EC2 instance that does not have this issue. I did not make any changes to this box, the only difference is that it is running Precise 12.04.2 LTS while my problem machine is running Precise 12.04.3 LTS.
Any help would be greatly appreciated.