[DOCS-2131] Improve Linux transparent hugepages details in production notes Created: 22/Oct/13 Updated: 30/Oct/23 Resolved: 03/Apr/15 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | manual |
| Affects Version/s: | None |
| Fix Version/s: | Server_Docs_20231030 |
| Type: | Task | Priority: | Critical - P2 |
| Reporter: | Kevin Pulo | Assignee: | Michael Paik |
| Resolution: | Done | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||
| Days since reply: | 7 years, 29 weeks ago | ||||||||||||||||||||||||||||
| Description |
|
The Linux Recommended Configuration section of the MongoDB production notes states
There are a few issues with this.
Regarding the first point, it would be sufficient to adjust the sentence to read "Ensure that transparent hugepages are disabled, as MongoDB performs better with normal virtual memory pages" or some-such. I believe that THP is only enabled by default in RHEL6 and SLES11 (and derivatives), and is disabled otherwise, but this might not be the case. If it is, this issue's relevance can be expected to increase over time as existing RHEL5 based systems are progressively upgraded to RHEL6. To check if THP is enabled, users need to check the contents of /sys/kernel/mm/transparent_hugepage/enabled or /sys/kernel/mm/redhat_transparent_hugepage/enabled on Redhat-derived systems (ie. RHEL, CentOS, Amazon, etc). Some systems may have /sys/kernel/mm/transparent_hugepage as a symlink to /sys/kernel/mm/redhat_transparent_hugepage. Users could potentially be instructed to run
to determine this in a Linux distro agnostic way. If neither of these files are present, then THP support is not compiled into the Linux kernel, and so is as good as disabled. If THP is enabled, the output will look like:
or on some systems:
If THP is disabled, the output will look like one of:
To check possible performance problems arising from THP, users can check the khugepaged kernel thread process, as well as the contents of the other files in /sys/kernel/mm/*transparent_hugepage. In particular, any of the following are red flags:
To disable THP temporarily (eg. to assess any possible impact), users can run as root:
or equivalently as a regular user:
This will stop khugepaged from performing any actions. Restarting mongod is not required for the new THP settings to take effect. When disabling THP, any previously allocated transparent hugepages (reported by AnonHugePages in /proc/meminfo) will not be broken up. In most situations, this is unlikely to be a problem, but if it is suspected, they can be cleared by rebooting the host (and then immediately disabling THP again, or by disabling THP permanently, as below, prior to rebooting). To ensure THP is permanently disabled, users can either:
|
| Comments |
| Comment by Emily Hall [ 27/Jul/16 ] |
|
Closed for housekeeping on 7/27/2016 by Emily Hall. |
| Comment by Githook User [ 20/Mar/15 ] |
|
Author: {u'username': u'mpaik', u'name': u'Michael Paik', u'email': u'michael.paik@10gen.com'}Message: |
| Comment by Githook User [ 20/Mar/15 ] |
|
Author: {u'username': u'mpaik', u'name': u'Michael Paik', u'email': u'michael.paik@10gen.com'}Message: |
| Comment by Githook User [ 18/Mar/15 ] |
|
Author: {u'username': u'mpaik', u'name': u'Michael Paik', u'email': u'michael.paik@10gen.com'}Message:
|
| Comment by Githook User [ 18/Mar/15 ] |
|
Author: {u'username': u'mpaik', u'name': u'Michael Paik', u'email': u'michael.paik@10gen.com'}Message:
|
| Comment by Kevin Pulo [ 05/Jun/14 ] |
|
This comment expands on the rationale behind disabling THP when running MongoDB. For background, the main design goals of THP are:
The main problems with THP (in a MongoDB setting) are:
|