MongoDB Tuning: disable transparent huge pages cover image

MongoDB Tuning: disable transparent huge pages

a fix for Debian/Ubuntu

updated over 5 years ago

devops (5)
mongodb (2)
tuning (1)

disable-transparent-hugepages fix for Debian/Ubuntu

credit: victor-garcia-645096-unsplash.jpg

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


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