Skip to content

Instantly share code, notes, and snippets.

@egeneralov
Created December 26, 2019 16:58
Show Gist options
  • Select an option

  • Save egeneralov/0fdf2f796c7f0de4d104b63647ffef15 to your computer and use it in GitHub Desktop.

Select an option

Save egeneralov/0fdf2f796c7f0de4d104b63647ffef15 to your computer and use it in GitHub Desktop.
---
- hosts: all
gather_facts: no
vars:
sysctl:
vm.swappiness: 0
net.ipv4.tcp_wmem: 4096 65536 33554432
net.core.netdev_max_backlog: 262144
net.ipv4.tcp_no_metrics_save: 1
net.ipv4.tcp_moderate_rcvbuf: 1
net.ipv4.tcp_orphan_retries: 2
net.ipv4.tcp_tw_reuse: 1
net.ipv4.tcp_max_orphans: 262144
net.ipv4.tcp_max_syn_backlog: 262144
net.ipv4.tcp_fin_timeout: 4
vm.min_free_kbytes: 65536
net.netfilter.nf_conntrack_tcp_timeout_established: 7200
net.netfilter.nf_conntrack_checksum: 0
net.netfilter.nf_conntrack_max: 196608
net.netfilter.nf_conntrack_tcp_timeout_syn_sent: 15
net.ipv4.tcp_keepalive_time: 60
net.ipv4.tcp_keepalive_intvl: 10
net.ipv4.tcp_keepalive_probes: 3
net.core.somaxconn: 262144
net.ipv4.tcp_max_tw_buckets: 2000000
net.ipv4.tcp_timestamps: 0
fs.file-max: 806854
tasks:
- sysctl:
name: "{{ item.key }}"
value: "{{ item.value }}"
state: present
sysctl_set: yes
reload: yes
with_dict: "{{ sysctl }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment