Skip to content

Instantly share code, notes, and snippets.

@PyYoshi
Last active June 13, 2018 22:46
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save PyYoshi/a7ca64b6c92b5ef1834b to your computer and use it in GitHub Desktop.
Save PyYoshi/a7ca64b6c92b5ef1834b to your computer and use it in GitHub Desktop.
Disable Transparent Huge Pages on CoreOS
$ sudo -i
# vim /etc/systemd/system/disable-transparent-huge-pages.service
# systemctl enable disable-transparent-huge-pages
# systemctl start disable-transparent-huge-pages
# systemctl status disable-transparent-huge-pages
# cat /sys/kernel/mm/transparent_hugepage/enabled
# cat /sys/kernel/mm/transparent_hugepage/defrag
[Unit]
Description=Disable Transparent Huge Pages
[Service]
Type=oneshot
ExecStart=/usr/bin/sh -c "/usr/bin/echo "never" | tee /sys/kernel/mm/transparent_hugepage/enabled"
ExecStart=/usr/bin/sh -c "/usr/bin/echo "never" | tee /sys/kernel/mm/transparent_hugepage/defrag"
[Install]
WantedBy=multi-user.target
@erkolson
Copy link

The quoting as displayed here does not work. I removed the quotes around "never" but perhaps escaping them would work too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment