Skip to content

Instantly share code, notes, and snippets.

@vitalbh
Created December 1, 2015 20:10
Show Gist options
  • Save vitalbh/5de76bb4146fbc98424d to your computer and use it in GitHub Desktop.
Save vitalbh/5de76bb4146fbc98424d to your computer and use it in GitHub Desktop.
network_tunning_hi_traffic
#!/bin/sh -e
echo "1024" > /proc/sys/net/core/somaxconn
echo "1" > /proc/sys/net/ipv4/tcp_syncookies
echo "4096 87380 16777216" > /proc/sys/net/ipv4/tcp_rmem
echo "4096 65536 16777216" > /proc/sys/net/ipv4/tcp_wmem
echo "0" > /proc/sys/net/ipv4/tcp_timestamps
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout
echo "5" > /proc/sys/net/ipv4/tcp_keepalive_probes
echo "15" > /proc/sys/net/ipv4/tcp_keepalive_intvl
echo "16777216" > /proc/sys/net/core/wmem_max
echo "32784" > /proc/sys/net/core/netdev_max_backlog
echo "1" > /proc/sys/net/ipv4/tcp_syncookies
echo "1024 65535" > /proc/sys/net/ipv4/ip_local_port_range
echo "4096" > /proc/sys/net/ipv4/tcp_max_syn_backlog
echo "3221039" > /proc/sys/fs/file-max
echo "0" > /proc/sys/net/netfilter/nf_conntrack_checksum
echo "0" > /proc/sys/net/netfilter/nf_conntrack_events
echo "0" > /proc/sys/net/netfilter/nf_conntrack_acct
echo "500000" > /proc/sys/net/netfilter/nf_conntrack_max
echo "40000" > /sys/module/nf_conntrack/parameters/hashsize
echo "86400" > /proc/sys/net/netfilter/nf_conntrack_tcp_timeout_established
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment