Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions modules/install/pages/thp-disable.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<using-thp-service, use the instructions to install the THP disabler as a system service.>>




[#init-script]
== Using Init Script

Expand Down Expand Up @@ -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
----