diff --git a/modules/install/pages/thp-disable.adoc b/modules/install/pages/thp-disable.adoc index 9223c4e671..c5cce77ac0 100644 --- a/modules/install/pages/thp-disable.adoc +++ b/modules/install/pages/thp-disable.adoc @@ -14,6 +14,11 @@ However, THP is detrimental to Couchbase's performance (as it is for nearly all You must disable THP on Linux systems to ensure the optimal performance of Couchbase Server. +NOTE: If you are using Rocky Linux, then <> + + + + [#init-script] == Using Init Script @@ -237,3 +242,66 @@ If THP is properly disabled, the output of both commands should be the following ---- always madvise [never] ---- + +[#using-thp-service] +== Using a THP Service + +. Create a service file. ++ +[source, console] +---- +vi /etc/systemd/system/disable-thp.service +---- + +. Add the service configuration details to the file and then save it. ++ +[source, console] +---- +[Unit] +Description=Disable Transparent Huge Pages (THP) +DefaultDependencies=no +After=sysinit.target local-fs.target +Before=couchbase-server.service + +[Service] +Type=oneshot +ExecStart=/bin/sh -c 'echo never | tee /sys/kernel/mm/transparent_hugepage/enabled > /dev/null' +ExecStart=/bin/sh -c 'echo never | tee /sys/kernel/mm/transparent_hugepage/defrag > /dev/null' + +[Install] +WantedBy=basic.target +---- + +. Reload the `systemctl` files. ++ +[source, console] +---- +sudo systemctl daemon-reload +---- + +. Start the service. ++ +[source, console] +---- +sudo systemctl start disable-thp +---- + +. Ensure that the service will start whenever the system is rebooted. ++ +[source, console] +---- +sudo systemctl enable disable-thp +---- + +[#verify-thp-service] +== Verify THP is Disabled + +Execute the following commands to ensure the service has disabled the THP. + +[source, console] +---- +cat /sys/kernel/mm/transparent_hugepage/enabled +cat /sys/kernel/mm/transparent_hugepage/defrag +---- + +