net.core.netdev_max_backlog = 20480
net.core.optmem_max = 4088000
net.core.rmem_default = 262144
net.core.rmem_max = 4088000
net.core.wmem_default = 513920
net.core.wmem_max = 4088000
net.core.somaxconn = 1024
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 131072 262144 524288
net.ipv4.tcp_rmem = 131400 256960 4088000
net.ipv4.tcp_wmem = 131400 256960 4088000
net.ipv4.udp_mem = 131072 262144 524288
net.ipv4.udp_rmem_min = 513920
net.ipv4.udp_wmem_min = 513920
net.ipv4.tcp_reordering = 64
#net.ipv4.tcp_low_latency = 1
net.ipv4.tcp_app_win = 64
#inet.ipv4.tcp_westwood = 1
#net.ipv4.tcp_bic = 1
net.ipv4.tcp_mtu_probing=1
net.ipv4.tcp_congestion_control=highspeed
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv4.tcp_congestion_control=highspeed 是Linux TCP的一种拥塞控制算法。 内核配置时没有选中就不要添加了。
把上述保存到 /etc/sysctl.conf
执行 /sbin/sysctl -p 使配置生效。
在Linux上检查TCP拥塞控制算法
默认情况下,Linux使用Reno和CUBIC拥塞控制算法,要检查可用的拥塞控制算法
sysctl net.ipv4.tcp_available_congestion_control
输出如下:
net.ipv4.tcp_available_congestion_control = cubic reno
要检查当前使用的拥塞控制算法
sysctl net.ipv4.tcp_congestion_control
输出如下:
net.ipv4.tcp_congestion_control = cubic
使用 cubic 这个默认的算法。
原文链接:https://blog.csdn.net/xiaoting451292510/article/details/105308764