Skip to content

Commit 2354fbf

Browse files
authored
[DOC-12729/release/7.2]: Feedback on Disabling Transparent Huge Pages (THP) (#3733)
* [DOC-12729]: Feedback on Disabling Transparent Huge Pages (THP) | Couchbase Docs Added extra details concerning the RSS and OOM kill. * [DOC-12729]: Feedback on Disabling Transparent Huge Pages (THP) | Couchbase Docs Changes made following review
1 parent 4e28cab commit 2354fbf

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

modules/install/pages/thp-disable.adoc

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,28 @@
33
:tabs:
44

55
[abstract]
6+
--
67
{description}
7-
THP must be disabled in order for Couchbase Server to function correctly on Linux.
8+
9+
THP must be disabled in order for Couchbase Server to function correctly on Linux, as having THP enabled can worsen performance and possibly lead to an OOM kill.
10+
--
11+
12+
In Linux operating systems, _huge pages_ is a feature that provides a way for the CPU and OS to create pre-allocated contiguous memory space, and which is designed to improve application performance.
13+
_Transparent huge pages (THP)_ is a Linux OS feature that automates the creation of contiguous memory space and conceals much of the complexity of using actual huge pages on systems with large amounts of memory.
14+
15+
THP is enabled by default in most Linux operating systems, and functions very well for most applications and processes.
16+
However, THP is detrimental to Couchbase's performance (as it is for nearly all databases that tend to have sparse rather than contiguous memory access patterns).
17+
18+
Since we tend to have more random, sparse data access, we allocate pages that can remain mostly empty.
19+
This leads to memory fragmentation as portions of memory are not used but still accounted for in the RSS.
20+
21+
As a result, the data stored which we keep track of may be smaller while RSS can be significantly higher,
22+
leading to possible OOM kill.
23+
24+
Therefore, you must disable THP on Linux systems to ensure the optimal performance of Couchbase Server.
825

926
In Linux operating systems, _huge pages_ is a feature that provides a way for the CPU and OS to create pre-allocated contiguous memory space, and which is designed to improve application performance.
10-
_Transparent huge pages (THP)_ is a Linux OS feature that automates the creation of contiguous memory space, and conceals much of the complexity of using actual huge pages on systems with large amounts of memory.
27+
_Transparent huge pages (THP)_ is a Linux OS feature that automates the creation of contiguous memory space and conceals much of the complexity of using actual huge pages on systems with large amounts of memory.
1128

1229
THP is enabled by default in most Linux operating systems, and functions very well for most applications and processes.
1330
However, THP is detrimental to Couchbase's performance (as it is for nearly all databases that tend to have sparse rather than contiguous memory access patterns).
@@ -81,7 +98,7 @@ sudo chmod 755 /etc/init.d/disable-thp
8198
8299
. Configure the OS to run the script on boot.
83100
+
84-
[{tabs}]
101+
[tabs]
85102
====
86103
Red Hat, CentOS, & Amazon Linux::
87104
+
@@ -125,7 +142,7 @@ When they are in use on a system, they can be used to enable and disable THP.
125142
126143
To disable THP in `tuned` and `ktune`, you need to edit or create a new _profile_ that sets THP to `never`.
127144
128-
[{tabs}]
145+
[tabs]
129146
====
130147
Red Hat/CentOS 7::
131148
+

0 commit comments

Comments
 (0)