net.core.rmem_default = N #接受
net.core.rmem_max = N
net.core.wmem_default = N #发送
net.core.wmem_max = N
# ping 192.168.100.1
PING 192.168.100.1 (192.168.100.1) 56(84) bytes of data.
64 bytes from 192.168.100.1: icmp_seq=1 ttl=64 time=0.038 ms
64 bytes from 192.168.100.1: icmp_seq=2 ttl=64 time=0.033 ms
^C
--- 192.168.100.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.033/0.035/0.038/0.006 ms
取:avg = 0.035
总buffer = 网卡支持的最大带宽 * 延迟的平均值
total_buffer(KB) = 1000(千兆网卡)*1024(bps)/8 * 0.035(ms) * 10^-3
tcp_window_scaling = 1
net.ipv4.tcp_mem min defalut max
net.ipv4.tcp_rmem min defalut max
net.ipv4.tcp_wmem min defalut max
net.ipv4.ipfrag_high_thresh #用于作tcp分片重组的最大缓冲值
net.ipv4.ipfrag_low_thresh
net.ipv4.ipfrag_time #默认30s
# netstat -s
- 是否使用处于TIME-WAIT状态的连接来处理新请求
net.ipv4.tcp_tw_reuse
tcp_syncookies
- tcp孤儿进程 (没有关联到fd的tcp连接),定义tcp孤儿的保留数,通常需要增大
tcp_max_orphans
tcp_fin_timeout
- 内核同时持有tcp timeout连接的数量,通常需要增大
tcp_max_tw_buckets
net.core.somaxconn
net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.tcp_synack_retries = 1