I keep getting WARNING about THP although it is already disabled

1.7k views Asked by At

Every time I reboot my server, I always keep getting this error from redis:

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.

When I did this command sudo sysctl -a | grep hugepage, the result is:

vm.hugepages_treat_as_movable = 0
vm.nr_hugepages = 0
vm.nr_hugepages_mempolicy = 0
vm.nr_overcommit_hugepages = 0
# cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]

Why I keep getting this error?

$ cat /etc/rc.local

if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
   echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi

if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
   echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi

exit 0`
1

There are 1 answers

0
user1801605 On

Accidentally, it was fixed after I upgrade the redis from 3.0 to 3.2