Dan Levy's Avatar DanLevy.net

MongoDB: Disable transparent huge pages

A fix for Debian/Ubuntu

MongoDB: Disable transparent huge pages

disable-transparent-hugepages fix for Debian/Ubuntu

Are you getting “WARNING: /sys/kernel/mm/transparent_hugepage/defrag is ‘always’.” ?

Run the following commands to quickly do what MongoDB describes at greater length.

## Currently just debian
sudo curl -sSL -o /etc/init.d/disable-transparent-hugepages https://gist.githubusercontent.com/justsml/5e8f10892070072c4ffb/raw/disable-transparent-hugepages
sudo chmod 755 /etc/init.d/disable-transparent-hugepages
sudo update-rc.d disable-transparent-hugepages defaults

References

  1. https://docs.mongodb.org/v3.0/tutorial/transparent-huge-pages/
Edit on GitHubGitHub