Created
March 6, 2018 06:31
-
-
Save vlasky/6a26961f0eaa8898f6cf992c4718421e to your computer and use it in GitHub Desktop.
Systemd startup script to automatically disable Transparent Huge Pages (THP) under Linux. This must be done before launching MySQL with the TokuDB storage engine or before launching MongoDB.
This file contains hidden or 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
# Copy this file to /etc/systemd/system/ | |
# Then run: | |
# systemctl enable disable_transparent_huge_pages.service | |
# systemctl start disable_transparent_huge_pages.service | |
[Unit] | |
Description=Disable transparent huge pages | |
[Service] | |
Type=oneshot | |
ExecStart=/bin/sh -c "/usr/bin/echo never | /usr/bin/tee /sys/kernel/mm/transparent_hugepage/enabled" | |
ExecStart=/bin/sh -c "/usr/bin/echo never | /usr/bin/tee /sys/kernel/mm/transparent_hugepage/defrag" | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment