“WARNING: soft rlimits too low” in MongoDB with Mac OS X

If you get this warning when you connect to mongo shell in Mac OS X:

** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000

A simple way to fix this is setting the limit just before starting mongod with this:

ulimit -n 1024 && mongod

Or this:

launchctl limit maxfiles 1024 1024

But if you are running mongo in a development environment this shouldn’t be a problem, you can just ignore it.

This is a temporary and not very pretty fix. To make this permanent you have to add this to the /etc/launchd.conf file:

launchctl limit maxfiles 1024 1024

Now reboot to make changes effective.

You can see the actual values of the limits running this:

$ launchctl limit maxfiles
        maxfiles    1024           1024

Remember to restart your mongod process every time you change any value to see if it works.

You might also like

Install MongoDB and the PHP driver in CentOS
Install MongoDB serverCreate the /etc/yum.repos.d/mongodb-org-3.0.repo file with this content:name=MongoDB...

Fix locale problems in Raspbian
If you get errors like this while running commands on your Raspbian:perl: warning: Setting locale...

Install MongoDB in Ubuntu 12.04 with PHP driver
Install MongoDB:sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 echo...

Shrink MongoDB journal files
Trying to get some space in my harddrive I noticed that the journal files of MongoDB where around 3GB.Fixing...

  1. These commands do not work

  2. This is helpful, thanks. It looks like Apple has removed /etc/launchctl.conf in 10.10 (Yosemite). See: http://stackoverflow.com/a/26311753/128501

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.