boorad home

Mac File Limit stuffs

27 Jul 2009 – en route ATLBOS

Like everyone else who does moderately sophisticated server development, and especially the ones using Erlang, I hit the file descriptor limit for Mac OS X. I was hackng on Dynomite, testing the Membership2 branches’ bootstrap module, which moves files from one node to another during a join event. Erlang runs everything as lightweight threads, and if sockets are involved, they’re using file descriptors from the OS. The default on my MacBook was insanity-low, at 256. The solution is usually to:

% ulimit -n 1024

or some number of your choosing, like 512 or so. Fine, did that. But my open shells still had the old limit, and in addition, I wanted to make the change permanent. So, reading here, here, here, and here, I did the following (from the first article):


limit maxfiles 1024 unlimited

A coworker with a similar MacBook reported being able to use 8192 but I couldn’t get that to work. When I went above 1024 in the launchd.conf file, any call to erl with -name or -sname made epmd hang. So things are working now, and I’m moving on. Hope this was useful to someone.

blog comments powered by Disqus
Fork me on GitHub