diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2020-11-02 01:28:40 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2020-11-02 01:28:40 +0100 |
commit | 787652f46cce3263dac529679f290597eefb1e74 (patch) | |
tree | 5427189b3612e8ae7c52a6d71455ddea61df462c | |
parent | e603fb6732501b9e501fe378306a5714285fdfe3 (diff) |
kernel parameters: Disable SYN cookies and improve SYN backlog handling.
See tcp(7) and https://levelup.gitconnected.com/linux-kernel-tuning-for-high-performance-networking-high-volume-incoming-connections-196e863d458a .
-rw-r--r-- | roles/common/tasks/sysctl.yml | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/roles/common/tasks/sysctl.yml b/roles/common/tasks/sysctl.yml index 3bf3b4f..f95b7fa 100644 --- a/roles/common/tasks/sysctl.yml +++ b/roles/common/tasks/sysctl.yml @@ -11,10 +11,16 @@ - { name: 'net.ipv4.conf.default.rp_filter', value: 1 } - { name: 'net.ipv4.conf.all.rp_filter', value: 1 } - # Enable TCP/IP SYN cookies to avoid TCP SYN flood attacks. We - # rate-limit not only the default ICMP types 3, 4, 11 and 12 + # Disable SYN cookies and improve SYN backlog handling, see tcp(7) and + # https://levelup.gitconnected.com/linux-kernel-tuning-for-high-performance-networking-high-volume-incoming-connections-196e863d458a + # TODO bullseye: remove net.core.somaxconn as 5.4 and later default to 4096 + - { name: 'net.ipv4.tcp_syncookies', value: 0 } + - { name: 'net.ipv4.tcp_synack_retries', value: 1 } + - { name: 'net.ipv4.tcp_max_syn_backlog', value: 32768 } + - { name: 'net.core.somaxconn', value: 4096 } + + # We rate-limit not only the default ICMP types 3, 4, 11 and 12 # (0x1818), but also types 0 and 8. See icmp(7). - - { name: 'net.ipv4.tcp_syncookies', value: 1 } - { name: 'net.ipv4.icmp_ratemask', value: 6425 } - { name: 'net.ipv4.icmp_ratelimit', value: 1000 } |