Open WALL-E opened 7 years ago
ss -ti sport == :22
State Recv-Q Send-Q Local Address:Port Peer Address:Port
ESTAB 0 0 172.28.32.101:ssh 172.28.66.22:63527
cubic wscale:5,7 rto:201 rtt:0.888/0.845 ato:40 mss:1448 cwnd:10 ssthresh:136 send 130.5Mbps lastsnd:3 lastrcv:5 lastack:3 pacing_rate 260.8Mbps retrans:0/1 reordering:6 rcv_rtt:4 rcv_space:28960
几个关键值
[root@dockerHost-102 ~]# ip tcpmetrics|grep ss
23.23.78.154 age 541419.983sec rtt 349500us rttvar 349500us ssthresh 2 cwnd 1 metric_5 2796353 metric_6 1398176
ip route replace 172.28.32.102/32 via 172.28.32.101 ssthresh 24 initcwnd 10 initrwnd 65535 congctl reno
Linux中不能关闭tcp拥塞算法。当前内核,默认的拥塞算法是cubic,可用的拥塞算法有:
[root@vagrant-172-28-32-101 linux-3.10.107]# cat /boot/config-`uname -r`|grep "CONFIG_TCP_CONG"
CONFIG_TCP_CONG_BIC=m
CONFIG_TCP_CONG_CUBIC=y
CONFIG_TCP_CONG_WESTWOOD=m
CONFIG_TCP_CONG_HTCP=m
CONFIG_TCP_CONG_HSTCP=m
CONFIG_TCP_CONG_HYBLA=m
CONFIG_TCP_CONG_VEGAS=m
CONFIG_TCP_CONG_SCALABLE=m
CONFIG_TCP_CONG_LP=m
CONFIG_TCP_CONG_VENO=m
CONFIG_TCP_CONG_YEAH=m
CONFIG_TCP_CONG_ILLINOIS=m
CONFIG_TCP_CONG_DCTCP=m
ethtool -K eth0 tso off gso off gro off
ip route replace 172.28.32.101/32 via 172.28.32.101 ssthresh 32 initcwnd 1 initrwnd 65535 congctl reno
吾生也有涯,而知也无涯。以有涯随无涯,殆已;已而为知者,殆而已矣!
关键参数
内核参数
net.ipv4.tcp_allowed_congestion_control cubic reno
Show/set the congestion control choices available to non-privileged processes. The list is a subset of those listed in tcp_available_congestion_control. Default is "reno" and the default setting (tcp_congestion_control).
net.ipv4.tcp_available_congestion_control cubic reno
Shows the available congestion control choices that are registered. More congestion control algorithms may be available as modules, but not loaded.
net.ipv4.tcp_congestion_control cubic
Set the congestion control algorithm to be used for new connections. The algorithm "reno" is always available, but additional choices may be available based on kernel configuration. Default is set as part of kernel configuration. For passive connections, the listener congestion control choice is inherited. [see setsockopt(listenfd, SOL_TCP, TCP_CONGESTION, "name" ...) ]