[DOCS-5573] Improve disable transparent huge pages docs when using tuned Created: 05/Jun/15  Updated: 30/Oct/23  Resolved: 26/Aug/15

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

Type: Improvement Priority: Minor - P4
Reporter: Emilio Scalise Assignee: Andrew Aldridge
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates DOCS-5330 Using /etc/rc.local to disable THP re... Closed
Related
is related to DOCS-5330 Using /etc/rc.local to disable THP re... Closed
Participants:
Days since reply: 8 years, 36 weeks, 5 days ago

 Description   

Hi,
in http://docs.mongodb.org/manual/tutorial/transparent-huge-pages/#using-tuned-and-ktune-necessary-if-you-use-tuned
you say to:
cp -r /etc/tune-profiles/default /etc/tune-profiles/no-thp

this file is not present on redhat/centos 7.x anymore (and maybe on 6.x I've not verified).

A good solution to fix that could be like said on:
http://serverfault.com/questions/688392/disable-thp-and-thp-defrag-on-centos-7-ec2-instance

In particular this reply:

In addition to setting the grub command line, you also need to configure tuned. But not using the instructions you linked to, as they are so full of errors it would take half a day just to explain them all.

Create a custom tuned profile (which I'll call custom), and then set the profile. You will base it on an existing profile, such as virtual-guest if you are running in a virtual machine (EC2 is, of course), or throughput-performance if you are on a physical machine.

Create the directory to hold the custom profile:

mkdir /etc/tuned/custom
Create the custom profile /etc/tuned/custom/tuned.conf, for example:

[main]
include=virtual-guest

[vm]
transparent_hugepages=never
Now set the profile:

tuned-adm profile custom


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