ansible-role-mongodb/templates/disable-transparent-hugepag...

18 lines
751 B
Plaintext
Raw Normal View History

# {{ ansible_managed }}
[Unit]
Description="Disable Transparent Hugepage before MongoDB boots"
#WARN: check service name on your system
# If you are using MongoDB Cloud, service name is "mongodb-mms-automation-agent.service"
Before={{ mongodb_daemon_name }}.service
[Service]
Type=oneshot
ExecStart=-/bin/bash -c 'echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled'
ExecStart=-/bin/bash -c 'echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag'
ExecStart=-/bin/bash -c 'echo 0 > /sys/kernel/mm/redhat_transparent_hugepage/khugepaged/defrag'
[Install]
#WARN: check service name on your system
# If you are using MongoDB Cloud, service name is "mongodb-mms-automation-agent.service"
RequiredBy={{ mongodb_daemon_name }}.service