Mongo error : “Two many open files”, mongod server doesn’t start

Solution 1(temporary and tested):

If you’re using bash, ulimit -n will only display the soft limit. To get the hard limit, you need to do ulimit -Hn.

On my system, I see this:

$ ulimit -n

Set ulimit value to new value as following:

$ ulimit -Hn

ulimit -n <value> (this will only set for current session, better do it in a screen mode and run it in background)

More info: Here

Solution 2 (permanent and not tested):

Modify /etc/security/limits.conf with what you need.


user soft nproc 64000

Restart machine to make the changes effective.

More info: Here

Start a Conversation

Your email address will not be published. Required fields are marked *