欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

linux内核的tcp/ip调优

程序员文章站 2024-03-22 21:04:28
...
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.ip_local_port_range = 5000 65000
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.tcp_max_syn_backlog = 2048
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2

参考:
#kernel.shmmax=67108864
#vm.min_free_kbytes = 65536
#vm.swappiness = 0
#net.core.rmem_max = 33554432
#net.core.wmem_max = 33554432
#net.core.netdev_max_backlog =  2500
#net.core.somaxconn = 262144
#net.ipv4.ip_local_port_range = 5000  65000
net.ipv4.tcp_max_syn_backlog = 2048
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2
#net.ipv4.tcp_tw_recycle = 0
#net.ipv4.tcp_tw_reuse = 1
#net.ipv4.tcp_rmem = 4096 16384 33554432
#net.ipv4.tcp_wmem = 4096 16384 33554432
#net.ipv4.tcp_mem = 786432 1048576 26777216
#net.ipv4.tcp_keepalive_time = 300
#net.ipv4.tcp_fin_timeout = 30
#net.ipv4.tcp_max_tw_buckets =360000
#net.ipv4.tcp_max_orphans =32768
#net.ipv4.tcp_window_scaling =1
#net.ipv4.tcp_timestamps =1
#net.ipv4.tcp_rfc1337 =1
 
相关标签: Linux .net