Move all shared into this new repo

This commit is contained in:
2020-04-02 15:48:20 -06:00
parent 27307f26f2
commit 66fd90a649
465 changed files with 61143 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
[Unit]
Description=Disable Transparent Huge Pages (THP)
[Service]
Type=simple
ExecStart=/bin/sh -c "echo 'never' > /sys/kernel/mm/transparent_hugepage/enabled && echo 'never' > /sys/kernel/mm/transparent_hugepage/defrag"
[Install]
WantedBy=multi-user.target

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
---
- name: restart redis
service: name=redis-server state=restarted
- name: disable thp
systemd:
name: disable-thp.service
daemon_reload: yes
enabled: yes
state: started

40
db/redis/tasks/main.yml Normal file
View File

@@ -0,0 +1,40 @@
---
- name: Installing redis
apt:
update_cache: yes
state: present
name: redis-server
# Enable Memory Overcommit /etc/sysctl.conf vm.overcommit_memory = 1
# View with sysctl -a |grep overcommit
- name: Enable Memory Overcommit /etc/sysctl.conf vm.overcommit_memory = 1
sysctl:
name: vm.overcommit_memory
value: 1
reload: yes
state: present
notify: restart redis # Only runs if file changed!
# Disable Swapping /etc/sysctl.conf vm.swappiness = 0
- name: Setting /etc/sysctl.conf vm.swappiness = 0
sysctl:
name: vm.swappiness
value: 0
reload: yes
state: present
notify: restart redis # Only runs if file changed!
# Disable THP (Transparent Huge Pages)
# View with cat /sys/kernel/mm/transparent_hugepage/enabled
# View with cat /sys/kernel/mm/transparent_hugepage/defrag
# Copy systemd unit /etc/systemd/system/disable-thp.service
- name: Disable Transperent Huge Pages using Systemd unit /etc/systemd/system/disable-thp.service
template:
src: "files/disable-thp.service"
dest: "/etc/systemd/system/disable-thp.service"
owner: root
group: root
mode: 0644 # -rw-r--r--
notify:
- disable thp
- restart redis # Only runs if file changed!