Last active
February 11, 2023 23:19
-
-
Save chetth/80ef1cd924a1bb958d10 to your computer and use it in GitHub Desktop.
TCP stack tuning for high traffic server.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
net.ipv4.ip_forward=0 | |
net.ipv4.tcp_fin_timeout = 60 | |
net.ipv4.tcp_retries1 = 3 | |
net.ipv4.tcp_keepalive_probes = 9 | |
net.ipv4.tcp_keepalive_time = 7200 | |
net.ipv4.tcp_syn_retries = 5 | |
kernel.sem = 250 32000 100 128 | |
kernel.shmall = 209715200 | |
kernel.shmmax = 214748364800 | |
kernel.shmmni = 4096 | |
fs.file-max = 1000000 | |
vm.swappiness = 0 | |
vm.vfs_cache_pressure = 50 | |
net.ipv4.tcp_fin_timeout = 3 | |
net.core.netdev_max_backlog = 30000 | |
net.ipv4.tcp_no_metrics_save = 1 | |
net.ipv4.tcp_synack_retries = 2 | |
net.ipv4.tcp_syn_retries = 2 | |
net.ipv4.tcp_max_syn_backlog = 8192 | |
net.core.rmem_max = 16777216 | |
net.core.wmem_max = 16777216 | |
net.ipv4.tcp_rmem = 4096 87380 16777216 | |
net.ipv4.tcp_wmem = 4096 65536 16777216 | |
net.core.somaxconn = 8192 | |
vm.min_free_kbytes = 65536 | |
net.ipv4.tcp_tw_reuse = 1 | |
net.ipv4.tcp_tw_recycle = 1 | |
net.ipv4.tcp_mem = 786432 1048576 1572864 | |
kernel.pid_max = 65536 | |
net.ipv6.conf.all.disable_ipv6=1 | |
net.ipv4.tcp_syncookies = 0 | |
#net.bridge.bridge-nf-call-iptables = 0 | |
net.ipv4.ip_local_port_range = 1024 65535 | |
net.ipv4.tcp_window_scaling = 1 | |
net.ipv4.tcp_max_syn_backlog = 3240000 | |
# increase socket listen backlog | |
net.core.somaxconn = 3240000 | |
net.ipv4.tcp_max_tw_buckets = 1440000 | |
# Increase TCP buffer sizes | |
net.core.rmem_default = 8388608 | |
net.core.rmem_max = 16777216 | |
net.core.wmem_max = 16777216 | |
net.ipv4.tcp_rmem = 4096 87380 16777216 | |
net.ipv4.tcp_wmem = 4096 65536 16777216 | |
net.ipv4.tcp_congestion_control = cubic | |
#----- Debian/Ubuntu ----------------- | |
#net.bridge.bridge-nf-call-iptables = 0 | |
#net.netfilter.nf_conntrack_max=204800 | |
#------ CentOS ----------------------- | |
net.nf_conntrack_max = 204800 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment