Transparent Hugepages is a Linux kernel feature intended to improve performance by making more efficient use of your processor’s memory-mapping hardware. It is enabled (“enabled=always”) by default in most Linux distributions.
Transparent Hugepages gives some applications a small performance improvement (~ 10% at best, 0-3% more typically), but can cause significant performance problems (to database engines for instance) or even apparent memory leaks at worst.
To check out the current status of the transparent hugepages in your standalone PVE node, log as your mgrsys
user in a shell and execute.
$ cat /sys/kernel/mm/transparent_hugepage/enabled
always [madvise] never
The highlighted value is madvise
, which means that transparent hugepages are enabled but not system wide. It's a feature available only for applications that request it specifically.
There's other parameter that hints about the usage of transparent hugepages, AnonHugePages
. To see its current value, execute the following command.
$ grep AnonHuge /proc/meminfo
AnonHugePages: 0 kB
At this point, no application has made use of transparent hugepages, so the value of AnonHugePages
is 0 KiB.
To switch the status of the transparent hugepages from madvise
to never
, you'll have to modify the configuration of your Debian's Grub boot system.
-
Open a shell as
mgrsys
,cd
to/etc/default/
and make a backup of the originalgrub
file.$ cd /etc/default/ $ sudo cp grub grub.orig
-
Edit the
grub
file, modifying theGRUB_CMDLINE_LINUX=""
line as follows.GRUB_CMDLINE_LINUX="transparent_hugepage=never"
-
Update the grub and reboot the system.
$ sudo update-grub $ sudo reboot
-
Log again as
mgrsys
and check the current status of the transparent hugepages.$ cat /sys/kernel/mm/transparent_hugepage/enabled always madvise [never]
/etc/default
/etc/default/grub
/etc/default/grub.orig
/proc/meminfo
/sys/kernel/mm/transparent_hugepage/enabled
- Transparent Hugepage Support
- Debian 10: How to disable transparent hugepages
- Disabling transparent hugepages on Ubuntu/Debian
- Which distributions enable transparent huge pages “for all applications”?
<< Previous (G015. Host optimization 01) | +Table Of Contents+ | Next (G017. Virtual Networking) >>