[DOCS-12902] Separately disabling THP defrag is not necessary when THP is disabled Created: 21/Jul/19  Updated: 30/Oct/23  Resolved: 31/Oct/19

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

Type: Improvement Priority: Minor - P4
Reporter: Eric Sommer Assignee: Andrew Feierabend (Inactive)
Resolution: Fixed Votes: 2
Labels: THP
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to DOCS-9197 Comment on: "manual/tutorial/transpar... Closed
is related to DOCS-9772 MongoDB 3.0 thp script does not disab... Closed
is related to DOCS-10693 Comment on: "manual/tutorial/transpar... Closed
is related to DOCS-12501 Disable Transparent Hugepages Doc Closed
is related to DOCS-10088 Add instructions on how to disable TH... Closed
is related to DOCS-11334 Update Transparent Huge Pages documen... Closed
is related to DOCS-9949 THP docs: tuned config doesn't turn o... Closed
is related to DOCS-12836 Instructions for disabling THP on RHE... Closed
is related to DOCS-12903 Requirement for disabling THP in both... Closed
Participants:
Days since reply: 4 years, 12 weeks, 5 days ago
Epic Link: DOCSP-1769
Story Points: 0.2

 Description   

Description

https://docs.mongodb.com/manual/tutorial/transparent-huge-pages/#create-the-init-d-script

This script includes steps for disabling THP and separately disabling THP defrag. In fact, when THP is disabled, separately disabling THP defrag is not necessary. While the extra step in not harmful, it is inconsistent with this article from RH, leading to potential confusion:

NOTE: Some third party application install scripts check value of above files and complain even if THP is disabled at boot time using transparent_hugepage=never, this is due to the fact when THP is disabled at boot time, the value of /sys/kernel/mm/redhat_transparent_hugepage/defrag will not be changed, however this is expected and system will never go in THP defragmentation code path when it is disabled at boot and THP defrag need not to be disabled separately.

The extra step of disabling THP defrag should either be removed or qualified as not necessary.

Note that leaving out the separate step of disabling defrag would also be consistent with `mongod`, whose startup warnings check for defrag only if it detects that THP is enabled. See https://github.com/mongodb/mongo/blob/1041dd848e25e879260d1015d8da4f72ee7993fe/src/mongo/db/startup_warnings_mongod.cpp#L261

Scope of changes

  • Make change and backport as necessary
  • Evaluate 9 other THP tickets and include fixes as appropriate. Note that some tickets request competing adjustments: determine which settings are required in modern deployments.

Impact to Other Docs

  • The following DOCS tickets are related to this ticket [and have been actioned upon]:
    • DOCS-9197 - Replace shell redirection with tee to work on Amazon Linux [fixed, this ticket]
    • DOCS-9772 - MDB 3.0 init script does not address khugepage/defrag [won't fix, superseded by this ticket]
    • DOCS-9949 - tuned profile config doesn't disable defrag [won't fix, superseded by this ticket]
    • DOCS-10088 - Expand THP instructions to other, non-RHEL/CentOS distros [fixed, this ticket]
    • DOCS-10693 - Add /etc/default custom settings to handle THP on Debian/Ubuntu systems [won't fix]
    • DOCS-11334 - Update tuned to remove defrag setting also [won't fix, superseded by this ticket]
    • DOCS-12501 - Add step to THP doc to start disable-transparent-hugepages service before reboot [fixed, this ticket]
    • DOCS-12836 - THP disable instructions should use systemd not init.d [deferred to be included in DOCS-13042]
    • DOCS-12903 - Clarify rationale for disabling THP in both init.d and tuned [fixed, this ticket]

MVP (Work and Date)

Resources (Scope or Design Docs, Invision, etc.)



 Comments   
Comment by maayan mordehai [ 15/Nov/19 ]

Hi, if separately disabling defrag is not necessary, you can use only tuned to disable transparent hugepages - I think in the documentation it should be tuned or the init.d.

Also in rhel 7 init.d is deprecated - systemd should be in use instead.

Comment by Githook User [ 31/Oct/19 ]

Author:

{'username': 'andf-mongodb', 'email': 'andrew.feierabend@mongodb.com', 'name': 'Andrew Feierabend'}

Message: DOCS-12902,DOCS-9197,DOCS-10088,DOCS-12501 update THP and tuned tutorial with current best practices
Branch: v3.6
https://github.com/mongodb/docs/commit/300bae303279839ab092097a76f8b859d29f7798

Comment by Githook User [ 31/Oct/19 ]

Author:

{'name': 'Andrew Feierabend', 'username': 'andf-mongodb', 'email': 'andrew.feierabend@mongodb.com'}

Message: DOCS-12902,DOCS-9197,DOCS-10088,DOCS-12501 update THP and tuned tutorial with current best practices
Branch: v4.0
https://github.com/mongodb/docs/commit/0e506d050d4175a90b177ecf1cd00b0fe03f5ca0

Comment by Githook User [ 31/Oct/19 ]

Author:

{'username': 'andf-mongodb', 'email': 'andrew.feierabend@mongodb.com', 'name': 'Andrew Feierabend'}

Message: DOCS-12902,DOCS-9197,DOCS-10088,DOCS-12501 update THP and tuned tutorial with current best practices
Branch: master
https://github.com/mongodb/docs/commit/4f9f3cd189147033ca9e5d0367849ab9ea4edec7

Comment by Andrew Feierabend (Inactive) [ 31/Oct/19 ]

Also resolves:

DOCS-9197 - AMZN shell redirection
DOCS-10088 - Confusion over supported platforms
DOCS-12501 - Run init script once before testing
• DOCS-12903 - Clarify rationale for disabling THP in both init.d and tuned

Generated at Thu Feb 08 08:06:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.