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

3,253 views
Skip to first unread message

DaveM

unread,
Mar 3, 2011, 2:45:25 PM3/3/11
to nodejs
anyone know about this error?

--------

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

events.js:23
throw arguments[1]; // Unhandled 'error' event
^
Error: ECONNREFUSED, Could not contact DNS servers
at dns.js:173:15
at Object.lookup (dns.js:169:11)
at Client.connect (net.js:689:20)
at Client._ensureConnection (http.js:1596:10)
at Client._cycle (http.js:1586:14)
at Client.request (http.js:1620:8)
at /usr/local/lib/node/.npm/pool/0.4.1/package/main.js:55:26
at Pool.getClient (/usr/local/lib/node/.npm/pool/0.4.1/package/
main.js:25:16)
at Pool.request (/usr/local/lib/node/.npm/pool/0.4.1/package/
main.js:54:8)
at Object.proxyRequest (/usr/local/lib/node/.npm/http-proxy/0.3.1/
package/lib/node-http-proxy.js:191:7)

DaveM

unread,
Mar 3, 2011, 2:45:25 PM3/3/11
to nodejs

Marak Squires

unread,
Mar 3, 2011, 2:50:18 PM3/3/11
to nod...@googlegroups.com, DaveM
You've got too many file descriptors open?

You can increase the amount of open FDs allowed by running the ulimit command on the console. 

Also, if you are hitting the limit of open FDs it might be indicative of a programming flaw causing FDs to be left open when they should be closed. 

--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.


Dean Landolt

unread,
Mar 3, 2011, 2:51:38 PM3/3/11
to nod...@googlegroups.com
On Thu, Mar 3, 2011 at 2:45 PM, DaveM <dmo...@gmail.com> wrote:
anyone know about this error?

--------

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


Or just search the mailing list archives.

DaveM

unread,
Mar 3, 2011, 2:53:05 PM3/3/11
to nodejs
Thanks for both quick responses!


On Mar 3, 11:51 am, Dean Landolt <d...@deanlandolt.com> wrote:

DaveM

unread,
Mar 3, 2011, 2:54:48 PM3/3/11
to nodejs
Link didn't help with os x.
still looking

On Mar 3, 11:51 am, Dean Landolt <d...@deanlandolt.com> wrote:

Marak Squires

unread,
Mar 3, 2011, 3:01:11 PM3/3/11
to nod...@googlegroups.com, DaveM
type: "ulimit -n" 

to see your current max file limit

type "ulimit -n 512"

to set limit to 512, etc



DaveM

unread,
Mar 3, 2011, 3:02:40 PM3/3/11
to nodejs
Tried that, but ulimit -n 512 not working, results in:

ulimit: max user processes: cannot modify limit: Operation not
permitted



Found this, am working through it:

http://blog.ghostinthemachines.com/2010/01/19/mac-os-x-fork-resource-temporarily-unavailable/

Marak Squires

unread,
Mar 3, 2011, 3:10:56 PM3/3/11
to nod...@googlegroups.com, DaveM
sudo ulimit ? 

DaveM

unread,
Mar 3, 2011, 3:17:37 PM3/3/11
to nod...@googlegroups.com, DaveM
tried that, didn't seem to work.

Mikeal Rogers

unread,
Mar 3, 2011, 3:17:31 PM3/3/11
to nod...@googlegroups.com
and just in case you didn't know, sockets are just fancy file descriptors so you could have too many open connections.

Mikeal Rogers

unread,
Mar 3, 2011, 3:23:11 PM3/3/11
to nod...@googlegroups.com
is this your local machine or is it a shared hosting environment?

DaveM

unread,
Mar 3, 2011, 3:58:20 PM3/3/11
to nod...@googlegroups.com
local machine - seems like default on osx 10.6 is 266.
for now, problem resolved by fixing browser issue (repeately connecting with Faye) - though it's a useful and reproducible test (of something)

shaun etherton

unread,
Mar 3, 2011, 6:55:59 PM3/3/11
to nod...@googlegroups.com
You might need

man sysctl
man sysctl.conf

http://osxbook.com/book/bonus/ancient/whatismacosx/arch_startup.html

HTH
--
Shaun Etherton
Mobile: 0433 143 761

@siculars

unread,
Mar 3, 2011, 10:42:15 PM3/3/11
to nodejs
not node specific but here is a post i put up about it in relation to
riak and another:

http://siculars.posterous.com/sad-face-too-many-open-files

https://help.basho.com/entries/331741-how-do-i-set-the-ulimit-n-on-mac-os-x

-alexander

Jonathan Chetwynd

unread,
Mar 4, 2011, 2:48:59 AM3/4/11
to nod...@googlegroups.com, DaveM
Dave,

attached my os x 10.6 help files

things changed for OS X,but my box is now stable-ish ~:"

regards

Jonathan Chetwynd
http://www.peepo.com

error message: (node)Hit maxfile limit. Increase 'ulimit -n' ulimit
does not function as required for os x 10.6

launchctl limit maxfiles 1024 2048

launchctl and launchd control jobs, vanilla flavoured instructions: http://blog.ghostinthemachines.com/2010/01/19/
mac-os-x-fork-resource-temporarily-unavailable/

$ sudo sysctl -w kern.maxproc=1024 // but see above

and edit .launchd.conf or /etc/launchd.conf and reboot

ulimit may then be raised. if necessary?


error:
need to close files when connection closes?
http://stackoverflow.com/questions/3214453/how-to-check-the-number-of-open-connections-in-node-js
Hit max file limit. Increase 'ulimit -n'.
see: https://github.com/ry/node/wiki/OS-x-snow-leopard
ulimit -a
ulimit -n 1024 // broken see: http://artur.hefczyc.net/node/27
launchctl limit // shows 256
launchctl limit maxfiles 1024 unlimited

lsof to list open files

DaveM

unread,
Mar 4, 2011, 4:07:47 AM3/4/11
to nod...@googlegroups.com, DaveM
thanks, found one of those links earlier.
problem seems to have resolved for now (tested with siege)

Reply all
Reply to author
Forward
0 new messages