basho/riak_wiki — pull request #224 by joedevivo (2011-12-02 21:39:31+00:00)
Title: Updated Open File Limits Page for OSX Lion

Using /etc/launchd.conf actually lowers the number of open file descriptors available to the kernel:

> ➜ ~ cat /etc/launchd.conf
> limit maxfiles 2048 2048
> ➜ ~ sysctl -a | grep -i files
> kern.maxfilesperproc = 2048
> kern.maxfiles: 2048
> kern.maxfilesperproc: 2048
> kern.num_files: 1962
>
> --- Restart ---
>
> ➜ ~ cat /etc/launchd.conf
> #limit maxfiles 2048 2048
> ➜ ~ sysctl -a | grep -i files
> kern.maxfiles = 12288
> kern.maxfilesperproc = 10240
> kern.maxfiles: 12288
> kern.maxfilesperproc: 10240
> kern.num_files: 1622

Adding `ulimit -n 4096` to ~/.profile is safer for overall system operation. `ulimit -n` is limited by kern.maxfilesperproc, so using /etc/launchd.conf lowers the ulimit ceiling.