Diasabling Transparent Huge Pages inside a container

Fathi

Renowned Member
May 13, 2016
136
5
83
53
Tunis, Tunisia
Hello,
I have the following error inside one of my containers, which prevents some software to work correctly:

# WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.

Then, when trying to disable it, I have the following error message:

[root@sso1 httpd]# echo never > /sys/kernel/mm/transparent_hugepage/enabled
-bash: /sys/kernel/mm/transparent_hugepage/enabled: Permission denied

Could someone help me to resolve this issue ?

TIA.
 
You have to follow the instructions on the host system.

As the container shares it's kernel with the host, it also shares THP and other memory related settings.
 
That depends on your setup. It will disable THP for all containers, VMs will most likely not see any difference.

If you're not using THP anywhere, it doesn't matter.
 
Personally, I left it to madvis, only those applications that request THP will have it done.

Cheers.