You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs-2.0-en/5.configurations-and-logs/1.configurations/6.kernel-config.md
+41-8
Original file line number
Diff line number
Diff line change
@@ -47,17 +47,50 @@ You can run `man limits.conf` for more helpful information.
47
47
48
48
These values control the dirty data cache for the system. For write-intensive scenarios, you can make adjustments based on your needs (throughput priority or delay priority). We recommend that you use the system default value.
49
49
50
-
### Transparent huge page
50
+
### Transparent Huge Pages
51
51
52
-
For better delay performance, you must run the following commands to disable the transparent huge pages (THP).
52
+
Transparent Huge Pages (THP) is a memory management feature of the Linux kernel, which enhances the system's ability to use large pages. In most database systems, Transparent Huge Pages can degrade performance, so it is recommended to disable it.
53
53
54
-
```bash
55
-
root# echo never > /sys/kernel/mm/transparent_hugepage/enabled
56
-
root# echo never > /sys/kernel/mm/transparent_hugepage/defrag
57
-
root# swapoff -a && swapon -a
58
-
```
54
+
Perform the following steps:
55
+
56
+
1. Edit the GRUB configuration file `/etc/default/grub`.
57
+
58
+
```bash
59
+
sudo vi /etc/default/grub
60
+
```
61
+
62
+
2. Add `transparent_hugepage=never` to the `GRUB_CMDLINE_LINUX` option, and then save and exit.
To prevent THP from being enabled again after the system restarts, you can modify the GRUB configuration file or `/etc/rc.local` to disable THP automatically upon system startup.
70
+
- For CentOS:
71
+
72
+
```bash
73
+
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
74
+
```
75
+
76
+
- For Ubuntu:
77
+
78
+
```bash
79
+
sudo update-grub
80
+
```
81
+
82
+
5. Reboot the computer.
83
+
84
+
```bash
85
+
sudo reboot
86
+
```
87
+
88
+
If you don't want to reboot, you can run the following commands to temporarily disable THP until the next reboot.
0 commit comments