[DOCS-5330] Using /etc/rc.local to disable THP results in spurious startup warning Created: 01/May/15  Updated: 30/Oct/23  Resolved: 31/Jul/15

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

Type: Improvement Priority: Major - P3
Reporter: Kevin Pulo Assignee: Andrew Aldridge
Resolution: Done Votes: 5
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by DOCS-5108 Comment on: "manual/reference/transpa... Closed
is duplicated by DOCS-5813 Comment on: "manual/tutorial/transpar... Closed
is duplicated by DOCS-5922 Comment on: "manual/tutorial/transpar... Closed
is duplicated by DOCS-5573 Improve disable transparent huge page... Closed
Related
related to DOCS-5487 Comment on: "manual/tutorial/transpar... Closed
related to DOCS-5430 Transparent Huge pages script does no... Closed
related to DOCS-2131 Improve Linux transparent hugepages d... Closed
related to SERVER-17522 THP startup warnings can become stale Closed
related to DOCS-5573 Improve disable transparent huge page... Closed
is related to DOCS-5979 Backport THP updates to 2.6/2.4 branches Closed
is related to SERVER-18113 Packages should disable transparent h... Closed
is related to SERVER-17418 After disabling transparent huge page... Closed
Participants:
Days since reply: 8 years, 28 weeks ago

 Description   

http://docs.mongodb.org/manual/reference/transparent-huge-pages/

This page suggests disabling THP in /etc/rc.local. However, when mongod is started from an init service, this will usually be earlier in the boot process than /etc/rc.local. This means that THP will still be active when mongod starts, resulting in startup warnings that will no longer be applicable once /etc/rc.local has run.

It would be useful if there was another, more reliable, way of generically disabling THP that doesn't have this problem.



 Comments   
Comment by Githook User [ 05/Aug/15 ]

Author:

{u'username': u'i80and', u'name': u'Andrew Aldridge', u'email': u'i80and@foxquill.com'}

Message: DOCS-5330: Tweak THP guide

Signed-off-by: kay <kay.kim@10gen.com>
Branch: v2.6
https://github.com/mongodb/docs/commit/d909023d9b86e5ac687f75dba4ca462b10c63c69

Comment by Githook User [ 31/Jul/15 ]

Author:

{u'username': u'i80and', u'name': u'Andrew Aldridge', u'email': u'i80and@foxquill.com'}

Message: DOCS-5330: Tweak THP guide

Signed-off-by: kay <kay.kim@10gen.com>
Branch: master
https://github.com/mongodb/docs/commit/cf3092408d9618d1f74eb71bc6addb07cadf29c1

Comment by Ben McCann [ 21/May/15 ]

I'd suggested the init script route as well in https://jira.mongodb.org/browse/SERVER-18113

Comment by Eric Milligan [ 21/May/15 ]

It might actually be nice to put this in the init script for mongod as a possible alternative to a documentation update.

Comment by Kevin Pulo [ 01/May/15 ]

A possible solution for Ubuntu is an init script such as:

# Ubuntu upstart file at /etc/init/thp.conf
 
pre-start script
end script
 
start on starting mongodb-mms-automation-agent
#start on starting mongod
stop on runlevel [!2345]
 
script
        if test -f /sys/kernel/mm/transparent_hugepage/khugepaged/defrag; then
          echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag
        fi
        if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
          echo never > /sys/kernel/mm/transparent_hugepage/defrag
        fi
        if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
          echo never > /sys/kernel/mm/transparent_hugepage/enabled
        fi
end script

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