Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-471

Documentation should cover recommended ulimit settings for Linux installation

      Documentation should cover the OS settings required to run mongodb at scale.

      Discussion:

      The Linux OS limits cover number of open files/sockets per process, number of threads per user, and various other per-process limits. If these are set too low, mongod/mongos will fail with various errors.

      For mongod running standalone or in a replica set (non-sharded):

      • One thread is allocated for each connection to the 'mongod' process
      • One file descriptor is used by each incoming connection
      • One file descriptor is used for each data file or journal file used by the database

      For mongos (running in a sharded cluster):

      • One thread is allocated for each incoming connection from a client
      • One file descriptor is used by each incoming connection
      • One file descriptor is used for a connection to each member of each shard

      Here are the values I'd recommend for the 'ulimit' settings for the MongoDB processes:

      • file size (-f) unlimited
      • cpu time (-t) unlimited
      • virtual memory (-v) unlimited
      • open files (-n) 21000
      • memory size (-m) unlimited
      • processes/threads (-u) 32000

      Diagnosing problems:

      On Linux, users can determine the limits for the mongod/mongos processes by examining the contents of the file /proc/$PID/limits, where $PID is the process ID of the mongod/mongos process in question.

            Assignee:
            sam.kleinman Sam Kleinman (Inactive)
            Reporter:
            william.zola@10gen.com William Zola
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              11 years, 31 weeks ago