Skip to content

Instantly share code, notes, and snippets.

@wilburding
Created July 22, 2015 02:19
Show Gist options
  • Save wilburding/21aaa0d06855966694be to your computer and use it in GitHub Desktop.
Save wilburding/21aaa0d06855966694be to your computer and use it in GitHub Desktop.
clear transparent_hugepage related warnings for mongod
[Unit]
Description=disable transparent huge page
[Service]
ExecStart=/bin/sh -c 'if test -f /sys/kernel/mm/transparent_hugepage/khugepaged/defrag; then /bin/echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag; fi'
ExecStart=/bin/sh -c 'if test -f /sys/kernel/mm/transparent_hugepage/defrag; then echo never > /sys/kernel/mm/transparent_hugepage/defrag; fi'
ExecStart=/bin/sh -c 'if test -f /sys/kernel/mm/transparent_hugepage/enabled; then echo never > /sys/kernel/mm/transparent_hugepage/enabled; fi'
Type=oneshot
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment