Disable transparent HugePages in Ubuntu or Kubuntu for TokuDB on boot

To enable TokuDB engine in MariaDB one has to be sure that transparent hugepages are disabled.

I assume you’ve already installed MariaDB and edited config files so that TokuDB should be enabled.

Test if transparent hugepages are enabled or disabled:

1
2
3
4
root@sheershoff-kbnt:/etc# cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]
root@sheershoff-kbnt:/etc# cat /sys/kernel/mm/transparent_hugepage/defrag
always madvise [never]

If you see

1
[never]

– then you’re all set. If TokuDB doesn’t get enabled after mysql restart – it’s probably not hugepages.

There are how-tos that tell how to turn off hugepages at boot, but they never made it work on Ubuntu. Add the following lines to

1
/etc/rc.local

before

1
exit 0

:

1
2
3
4
5
6
7
 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
service mysql restart

Reboot and check if TokuDB engine is enabled in mysql after reboot.

  • Facebook
  • Twitter
  • VKontakte
  • Google Plus
  • Delicious
  • StumbleUpon
  • Add to favorites