|
3 | 3 | :tabs:
|
4 | 4 |
|
5 | 5 | [abstract]
|
| 6 | +-- |
6 | 7 | {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. |
8 | 25 |
|
9 | 26 | 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. |
11 | 28 |
|
12 | 29 | THP is enabled by default in most Linux operating systems, and functions very well for most applications and processes.
|
13 | 30 | 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
|
81 | 98 |
|
82 | 99 | . Configure the OS to run the script on boot.
|
83 | 100 | +
|
84 |
| -[{tabs}] |
| 101 | +[tabs] |
85 | 102 | ====
|
86 | 103 | Red Hat, CentOS, & Amazon Linux::
|
87 | 104 | +
|
@@ -125,7 +142,7 @@ When they are in use on a system, they can be used to enable and disable THP.
|
125 | 142 |
|
126 | 143 | To disable THP in `tuned` and `ktune`, you need to edit or create a new _profile_ that sets THP to `never`.
|
127 | 144 |
|
128 |
| -[{tabs}] |
| 145 | +[tabs] |
129 | 146 | ====
|
130 | 147 | Red Hat/CentOS 7::
|
131 | 148 | +
|
|
0 commit comments