Only scrub when plugged in on Linux, and TCP optimization.
This commit is contained in:
parent
ee0fe7eca6
commit
f44074ebe7
@ -26,17 +26,6 @@
|
||||
daemon_reload: yes
|
||||
enabled: yes
|
||||
|
||||
# Of questionable value since I don't use swap on my machines
|
||||
- name: Configure sysctls for swap
|
||||
sysctl:
|
||||
name: "{{ item.name }}"
|
||||
value: "{{ item.value }}"
|
||||
state: present
|
||||
sysctl_file: /etc/sysctl.d/swap.conf
|
||||
loop:
|
||||
- name: vm.swappiness
|
||||
value: 10
|
||||
|
||||
- name: Install scripts
|
||||
copy:
|
||||
src: "files/{{ item.src }}"
|
||||
@ -49,3 +38,31 @@
|
||||
dest: /usr/local/bin/mount_disk_image
|
||||
- src: watch_linux
|
||||
dest: /usr/local/bin/ww
|
||||
|
||||
- name: Configure sysctls
|
||||
sysctl:
|
||||
name: "{{ item.name }}"
|
||||
value: "{{ item.value }}"
|
||||
state: present
|
||||
sysctl_file: /etc/sysctl.d/{{ item.file }}
|
||||
loop:
|
||||
# Of questionable value since I don't use swap on my machines
|
||||
- name: vm.swappiness
|
||||
value: 10
|
||||
file: swap.conf
|
||||
# Enable TCP packetization-layer PMTUD when an ICMP black hole is detected.
|
||||
- name: net.ipv4.tcp_mtu_probing
|
||||
value: 1
|
||||
file: tcp.conf
|
||||
# Switch to bbr tcp congestion control which should be better on lossy connections like bad wifi.
|
||||
- name: net.ipv4.tcp_congestion_control
|
||||
value: bbr
|
||||
file: tcp.conf
|
||||
# Don't do a slow start after a connection has been idle for a single RTO.
|
||||
- name: net.ipv4.tcp_slow_start_after_idle
|
||||
value: 0
|
||||
file: tcp.conf
|
||||
# 3x time to accumulate filesystem changes before flushing to disk.
|
||||
- name: vm.dirty_writeback_centisecs
|
||||
value: 1500
|
||||
file: power.conf
|
||||
|
2
ansible/roles/zfs/files/linux_scrub_when_plugged_in.conf
Normal file
2
ansible/roles/zfs/files/linux_scrub_when_plugged_in.conf
Normal file
@ -0,0 +1,2 @@
|
||||
[Unit]
|
||||
ConditionACPower=true
|
@ -61,3 +61,26 @@
|
||||
name: "zfs-scrub-weekly@{{ item }}.timer"
|
||||
daemon_reload: yes
|
||||
loop: "{{ periodic_scrub_pools }}"
|
||||
|
||||
- name: Create directories
|
||||
when: periodic_scrub_pools is defined
|
||||
file:
|
||||
name: "{{ item }}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: wheel # Normally it is "root"
|
||||
loop:
|
||||
- /etc/systemd/system/zfs-scrub-weekly@.timer.d
|
||||
|
||||
- name: Install Configuration
|
||||
when: periodic_scrub_pools is defined
|
||||
copy:
|
||||
src: "files/{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: wheel # Normally it is "root"
|
||||
loop:
|
||||
- src: linux_scrub_when_plugged_in.conf
|
||||
dest: /etc/systemd/system/zfs-scrub-weekly@.timer.d/override.conf
|
||||
|
Loading…
x
Reference in New Issue
Block a user