I have a problem setting the maximum incoming connections for my MongoDB
.
I ran ulimit -n 1000000
and restarted mongo, the last ping in my MMS dashboard shows:
"maxIncomingConnections": 1000000,
however:
"connections": {
"current": 701,
"totalCreated": 712,
"available": 118
},
as you can see current
+ available
is 819
which is the default (80% from 1024)
from system.
Any ideas?
I don't know as which user you ran the ulimit command, but keep in mind that this only is valid for the current user in the current environment.
A better approach is to set the open file limit in
/etc/security/limits.conf
like this:However, this is only a fallback in case you start MongoDB manually, since the upstart script should set the according limits. After adding these values, a reboot is needed iirc. The number of available connections should increase, then.
Note: Keep in mind that each connection gets about 1MB of stack allocated on the server, which then can not be used for holding indices and data within RAM.