[DOCS-471] Documentation should cover recommended ulimit settings for Linux installation Created: 31/Aug/12  Updated: 30/Oct/23  Resolved: 10/Oct/12

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Improvement Priority: Major - P3
Reporter: William Zola Assignee: Sam Kleinman (Inactive)
Resolution: Done Votes: 0
Labels: supportability
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
is duplicated by DOCS-510 Improve documentation on detecting ul... Closed
Related
is related to DOCS-510 Improve documentation on detecting ul... Closed
Participants:
Days since reply: 11 years, 18 weeks, 6 days ago

 Description   

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.



 Comments   
Comment by auto [ 11/Oct/12 ]

Author:

{u'date': u'2012-10-11T08:01:04-07:00', u'email': u'bob.grabar@10gen.com', u'name': u'Bob Grabar'}

Message: DOCS-471 minor edits
Branch: master
https://github.com/mongodb/docs/commit/adbe0b21f76496bfcd82f23a3f1b66d5ebdd60ba

Comment by auto [ 10/Oct/12 ]

Author:

{u'date': u'2012-10-10T13:53:54-07:00', u'email': u'samk@10gen.com', u'name': u'Sam Kleinman'}

Message: DOCS-471 changes to ulimit page and publishing.
Branch: master
https://github.com/mongodb/docs/commit/dbbb35bf67c8af23377374e80404d48de9332adc

Comment by auto [ 10/Oct/12 ]

Author:

{u'date': u'2012-10-10T08:21:40-07:00', u'email': u'samk@10gen.com', u'name': u'Sam Kleinman'}

Message: DOCS-471 adding note about ulimit
Branch: master
https://github.com/mongodb/docs/commit/2e6b2960557a7534300d0cd6510ee07991017949

Comment by auto [ 09/Oct/12 ]

Author:

{u'date': u'2012-10-09T15:31:06-07:00', u'email': u'samk@10gen.com', u'name': u'Sam Kleinman'}

Message: minor: DOCS-471 edits
Branch: master
https://github.com/mongodb/docs/commit/7966c0f5f601fa2a2e39aa86c81d52553c2c40c2

Comment by auto [ 09/Oct/12 ]

Author:

{u'date': u'2012-10-09T15:26:42-07:00', u'email': u'samk@10gen.com', u'name': u'Sam Kleinman'}

Message: merge: DOCS-471 edits
Branch: master
https://github.com/mongodb/docs/commit/b0062cc253d639f8d50a56ac01b29b92bc2b779c

Comment by auto [ 09/Oct/12 ]

Author:

{u'date': u'2012-10-09T15:13:01-07:00', u'email': u'bob.grabar@10gen.com', u'name': u'Bob Grabar'}

Message: DOCS-471: ulimit page: edits
Branch: master
https://github.com/mongodb/docs/commit/697b06628b146e96f6f910c59d2f788140489feb

Comment by auto [ 09/Oct/12 ]

Author:

{u'date': u'2012-10-09T14:30:47-07:00', u'email': u'samk@10gen.com', u'name': u'Sam Kleinman'}

Message: DOCS-471: ulimit page draft
Branch: master
https://github.com/mongodb/docs/commit/313eb77892037809e1a3bd53850fe9ea70fef3a2

Comment by Sam Kleinman (Inactive) [ 09/Oct/12 ]

What are the resource utilization factors of the mongod instances in a shard cluster, and how do they differ from more simple deployments?

Generated at Thu Feb 08 07:38:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.