What are the general OS side tuning configurations to increase the MongoDB performance in RHEL?
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 ofMongoDB
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:
- 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. - Using
MongoDB
in a clustered, replicated scenario isn't technically supported. - The
MongoDB
needs to collect and analyse stats to tune properly. Collect log files and timed statistical output. DEX
could be used to analyze and report possible slow queries due to improper primary key usage -
Mongolab Dex Link- The optimization of the actual hardware/system should be done first BEFORE optimizing
MongoDB
(update all hardware drivers, make sure hardware is running optimally) - 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
MongoDB Management System (MMS)
could also be used which is offered by MongoDB.com (offers some tuning capabilities).- Changing the io scheduler or the queue length improperly could seriously affect performance. Caution should be observed with this approach specifically.
Numa
should be disabled or configured per recommendations cited in MongoDB Production Notes.- 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