Files
octavia/elements/haproxy-octavia/post-install.d/20-haproxy-tune-kernel
Michael Johnson 421eecd1e5 Increase TCP buffer maximum and MTU discovery
This patch increases the maximum allowed TCP buffer memory to 32MB
and enabled MTU probe discovery when an ICMP black hole is detected.

This should improve reliability in some situations when the amphora are
provisioned on hosts with 10gbps or faster network adapters.

Change-Id: If7dc46ee18a46e3bd15756839f60ea5b51c9288b
2021-10-07 15:45:00 +00:00

33 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
set -eu
set -o pipefail
sysctl-write-value net.ipv4.tcp_max_tw_buckets 5800000
sysctl-write-value net.ipv4.tcp_max_orphans 5800000
sysctl-write-value net.ipv4.tcp_max_syn_backlog 100000
sysctl-write-value net.ipv4.tcp_keepalive_time 300
sysctl-write-value net.ipv4.tcp_tw_reuse 1
sysctl-write-value net.core.somaxconn 65534
sysctl-write-value net.ipv4.tcp_synack_retries 3
sysctl-write-value net.core.netdev_max_backlog 100000
# This should allow HAProxy maxconn to be 1,000,000
sysctl-write-value fs.file-max 2600000
sysctl-write-value fs.nr_open 2600000
# It's ok for these to fail if conntrack module isn't loaded
sysctl-write-value net.netfilter.nf_conntrack_tcp_timeout_time_wait 5 || true
sysctl-write-value net.netfilter.nf_conntrack_tcp_timeout_fin_wait 5 || true
# Enable MTU icmp black hole detection (RFC4821)
sysctl-write-value net.ipv4.tcp_mtu_probing 1
sysctl-write-value net.ipv4.tcp_fin_timeout 5
sysctl-write-value net.ipv4.ip_nonlocal_bind 1
sysctl-write-value net.ipv6.ip_nonlocal_bind 1
sysctl-write-value net.core.rmem_max 67108864
sysctl-write-value net.core.wmem_max 67108864
sysctl-write-value net.ipv4.tcp_rmem "4096 87380 33554432"
sysctl-write-value net.ipv4.tcp_wmem "4096 87380 33554432"
sysctl-write-value net.ipv4.ip_local_port_range "1025 65534"