Transparent Huge Pages is required to be disabled for the TokuDB engine and for Redis. With docker-toolbox, I could just docker-machine ssh into the host and disable it. I no longer have access to the host OS, so how do I disable it?
You can actually do this with a privileged container in Docker For Mac/Windows. You can do it like this:
docker run -ti --privileged ubuntu /bin/bash
echo never | tee /sys/kernel/mm/transparent_hugepage/enabled
echo never | tee /sys/kernel/mm/transparent_hugepage/defrag
I ended up creating an image for this and made redis/mariadb include it under depends_on in my docker-compose.yml file
FROM ubuntu:latest
COPY ./docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
where docker-entrypoint.sh has:
#!/bin/bash
set -e
echo never | tee /sys/kernel/mm/transparent_hugepage/enabled
echo never | tee /sys/kernel/mm/transparent_hugepage/defrag
An even easier solution is to create file profile with content
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag
and add following line to Dockerfile
COPY profile /var/lib/boot2docker/profile
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With