Recommended ulimit settings for MongoDB

685 views
Skip to first unread message

Kevin Layman

unread,
Jan 9, 2014, 1:24:05 PM1/9/14
to mongod...@googlegroups.com
Referring to http://docs.mongodb.org/manual/reference/ulimit/.

I found 2 differences in our ulimit settings from what Mongo recommends. What is the risk of not changing these? We are pretty far below on the max number of open files.

1. uname -n: Mongo recommends 64,000, and we set it to 1024. This is the maximum number of open files.
2. uname -u: Mongo recommends 32,000, and we set it to unlimited. This is the maximum number of processes or threads.

James

unread,
Jan 9, 2014, 1:54:11 PM1/9/14
to mongod...@googlegroups.com
There should be no harm setting max processes to 32K. Max open files at 1024 is quite low however. A file descriptor will be used for each open file and each socket connection opened. I have seen numerous cases where 1024 (which is often the default) is fine for a new mongod instance but is exceeded as usage grows. The implications are that when reached no new connections can be made to your mongod/mongos instance. This can affect both external clients and internal database operations. I would definitely increase this to the recommended value.

Also, please make sure to raise both soft and hard limits. The best way to check that your limits are correct is to look at the /proc/PID/limits file (as detailed here) to confirm.

James
Reply all
Reply to author
Forward
0 new messages