Connection limits are a property of a process . Within unix, the “hard” limit of maximum connections is the maximum ceiling for the “soft” limit. The ulimit -a command can be used to see what these values are set to. Note, the ulimit values refer to a per-user limitation.
Within MongoDB, the maxConns parameter can be used to set the maximum number of simultaneous connections that mongod or mongos will accept. However, maxConns cannot exceed the values set at the operating system level, and you cannot set maxConns to a value higher than 20000.
The netstat command can be used to see how many connections are being used.
You may see entries with a CLOSE_WAIT status. This indicates that the client is closing the connection but the application hasn't closed it yet. A socket can be in CLOSE_WAIT state indefinitely until the application closes it, so it is important to ensure sockets are closed properly.
If there are no issues with stale connections, but more are still needed, then you may want to consider using a connection pool.