Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-8943

max connections is hard coded to 20,000

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.2.3
    • Fix Version/s: 2.5.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      ubuntu, mongodb 2.2.3

      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?

        Issue Links

          Activity

          Hide
          mjburak Mary Burak added a comment -

          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

          Show
          mjburak Mary Burak added a comment - 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
          Hide
          charity@parse.com charity majors added a comment -

          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.

          Show
          charity@parse.com charity majors added a comment - 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.
          Hide
          auto auto (Inactive) added a comment -

          Author:

          {u'date': u'2013-05-01T22:09:56Z', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

          Message: SERVER-8943 Remove hard limit of 20,000 incoming connections.
          Branch: master
          https://github.com/mongodb/mongo/commit/99e6e03543459cf6c4fea61dc6d3c9b4b2ba5ed3

          Show
          auto auto (Inactive) added a comment - Author: {u'date': u'2013-05-01T22:09:56Z', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'} Message: SERVER-8943 Remove hard limit of 20,000 incoming connections. Branch: master https://github.com/mongodb/mongo/commit/99e6e03543459cf6c4fea61dc6d3c9b4b2ba5ed3

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                2 years, 3 weeks, 6 days ago
                Date of 1st Reply: