What are the general OS side tuning configurations to increase the MongoDB performance in RHEL?

Solution Unverified - Updated -

Environment

  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • MongoDB running on a RHEL guest in VMware environment

Issue

  • What are the OS tuning recommendations like queue size, io scheduler etc. to increase the MongoDB performance?
  • MongoDB cluster is running on four nodes in VMware. Does Red Hat provide any general recommendations to increase of MongoDB in such a scenario ?

Resolution

  • The way that DB systems are used affects greatly the performance. There are so many different ways that DB's are used, to supply "tuning recommendations" just really isn't possible. Tuning a DB is a complex and involved process that is affected by many factors. (i.e.) :-
    a. Hardware
    b. DB usage
    c. configuration
    d. application

  • So with that in mind, below are the best places to start:

  1. The MongoDB as it's supplied by Red Hat is "nominally tuned" for a small/light workload. For anything other, tuning will need to be performed.
  2. Using MongoDB in a clustered, replicated scenario isn't technically supported.
  3. The MongoDB needs to collect and analyse stats to tune properly. Collect log files and timed statistical output.
  4. DEX could be used to analyze and report possible slow queries due to improper primary key usage -
    Mongolab Dex Link
  5. The optimization of the actual hardware/system should be done first BEFORE optimizing MongoDB (update all hardware drivers, make sure hardware is running optimally)
  6. The DBA should be able to identify slow queries and would need to work with the application team to fix code. The below article is worth a read in this context :- Database-Profiling
  7. MongoDB Management System (MMS) could also be used which is offered by MongoDB.com (offers some tuning capabilities).
  8. Changing the io scheduler or the queue length improperly could seriously affect performance. Caution should be observed with this approach specifically.
  9. Numa should be disabled or configured per recommendations cited in MongoDB Production Notes.
  10. Avoid using nfs for mongo database location (dbpath =/var/lib/mongodb parameter in /etc/mongodb.conf).

Note : There are few hyperlinks mentioned above which point to sites on which Red Hat has no control.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments