Skip to content

Instantly share code, notes, and snippets.

@richardsonlima
Last active January 28, 2016 02:50
Show Gist options
  • Save richardsonlima/20a55ba1fba4f2c317fa to your computer and use it in GitHub Desktop.
Save richardsonlima/20a55ba1fba4f2c317fa to your computer and use it in GitHub Desktop.
- SysCtl Conf (kernel)
http://blog.richardsonlima.com.br/post/138189026200/coping-with-the-tcp-time-wait-state-on-busy-linux
net.ipv4.tcp_tw_reuse = 0
net.ipv4.tcp_tw_recycle = 0
net.ipv4.ip_local_port_range = 1024 65023
net.ipv4.tcp_max_syn_backlog = 10240
net.ipv4.tcp_max_tw_buckets = 400000
net.ipv4.tcp_max_orphans = 60000
net.ipv4.tcp_synack_retries = 3
net.core.somaxconn = 10000
fs.file-max = 999999
>> # sysctl -f
- Tests
dmesg | grep "TCP established hash table"
ss -tan | head -5
ss -tan 'sport = :80' | awk '{print $(NF)" "$(NF-1)}' | sed 's/:[^ ]*//g' | sort | uniq -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment