[SERVER-8943] max connections is hard coded to 20,000 Created: 11/Mar/13 Updated: 07/Apr/14 Resolved: 01/May/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 2.2.3 |
| Fix Version/s: | 2.5.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | charity majors | Assignee: | Mathias Stearn |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
ubuntu, mongodb 2.2.3 |
||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||
| Description |
|
The max connections appear to be 80% of soft ulimit until 20,000 is reached. It's hard-coded not to exceed that in https://github.com/mongodb/mongo/blob/master/src/mongo/util/net/listen.cpp. Can that hard-coded limit be lifted? |
| Comments |
| Comment by auto [ 01/May/13 ] |
|
Author: {u'date': u'2013-05-01T22:09:56Z', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}Message: |
| Comment by charity majors [ 25/Mar/13 ] |
|
No, I understand all that. I linked to the exact line in the code where it's hard coded not to exceed 20,000. It would be nicer if it just let you set the max connections to 80% of the soft ulimit, regardless what your ulimit is. |
| Comment by Mary Burak [ 25/Mar/13 ] |
|
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. http://docs.mongodb.org/manual/administration/ulimit/#ulimit 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. http://docs.mongodb.org/manual/reference/configuration-options/#maxConns 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. http://docs.mongodb.org/manual/reference/connection-string/#connection-pool-options |