Improve disable THP systemd unit file
This commit is contained in:
parent
885671595e
commit
bcc48b329e
|
@ -6,14 +6,9 @@ Before=mongodb.service
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=-/bin/bash -c 'echo never > /sys/kernel/mm/transparent_hugepage/enabled'
|
||||
ExecStart=-/bin/bash -c 'echo never > /sys/kernel/mm/transparent_hugepage/defrag'
|
||||
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/transparent_hugepage/khugepaged/defrag'
|
||||
ExecStart=-/bin/bash -c 'echo 0 > /sys/kernel/mm/redhat_transparent_hugepage/khugepaged/defrag'
|
||||
ExecStart=-/bin/bash -c 'echo no > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag'
|
||||
ExecStart=-/bin/bash -c 'echo no > /sys/kernel/mm/redhat_transparent_hugepage/khugepaged/defrag'
|
||||
|
||||
[Install]
|
||||
#WARN: check service name on your system
|
|
@ -0,0 +1,16 @@
|
|||
[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.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=-/bin/bash -c 'echo never > /sys/kernel/mm/transparent_hugepage/enabled'
|
||||
ExecStart=-/bin/bash -c 'echo never > /sys/kernel/mm/transparent_hugepage/defrag'
|
||||
ExecStart=-/bin/bash -c 'echo 0 > /sys/kernel/mm/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.service
|
|
@ -0,0 +1,16 @@
|
|||
[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.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.service
|
|
@ -1,11 +1,14 @@
|
|||
---
|
||||
- name: Create disable transparent hugepages systemd service file
|
||||
copy:
|
||||
src: disable-transparent-hugepages.service
|
||||
src: "{{ item }}"
|
||||
dest: /etc/systemd/system/disable-transparent-hugepages.service
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
with_first_found:
|
||||
- "disable-transparent-hugepages.{{ ansible_distribution | lower }}.service"
|
||||
- "disable-transparent-hugepages.{{ ansible_os_family | lower }}.service"
|
||||
|
||||
- name: Enable disable-transparent-hugepages.service
|
||||
systemd:
|
||||
|
|
Loading…
Reference in New Issue