Forked from nicksherron/disable-transparent-huge-pages.service
Created
April 20, 2022 23:15
-
-
Save ksalman/5ce905d216c73215b1870ccc0a571953 to your computer and use it in GitHub Desktop.
systemd service for disabling Transparent Huge Pages (THP) for dbs like mongodb and redis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Disable Transparent Huge Pages (THP) | |
DefaultDependencies=no | |
After=sysinit.target local-fs.target | |
Before=mongod.service | |
[Service] | |
Type=oneshot | |
ExecStart=/bin/sh -c 'echo never | tee /sys/kernel/mm/transparent_hugepage/enabled > /dev/null' | |
[Install] | |
WantedBy=basic.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment