Linux TCP throughput tuning
- https://meetup.toast.com/posts/53
- https://www.cdnplanet.com/blog/tune-tcp-initcwnd-for-optimum-performance/
- http://intronetworks.cs.luc.edu/1/html/newtcps.html
- https://serverfault.com/questions/546523/linux-initcwnd-and-initrwnd-via-etc-sysctl-conf
Increase Buffer Memory + @
net.core.rmem_default = 16777216 net.core.wmem_default = 16777216 net.core.rmem_max = 67108864 net.core.wmem_max = 67108864 net.ipv4.tcp_rmem = 253952 253952 16777216 net.ipv4.tcp_wmem = 253952 253952 16777216 net.ipv4.tcp_window_scaling = 1 net.core.netdev_max_backlog = 30000 net.core.somaxconn = 1024 net.ipv4.tcp_max_syn_backlog = 1024
Init Window
TCP는 낮은 값 부터 차근차근 윈도우사이즈를 늘린다.
근데 고레이턴시 환경에서는 이게 너무 쥐약이다
첫 연결 후 100MB 전송하는데 3초가 걸리는 환경에서
첫 연결 후 1MB 전송하는데 3초가 걸릴 수 도 있다.
명령확인
ip route | head -n 1 | while read p; do `echo ip route change $p initcwnd 10 initrwnd 10`; done
ip route change $(ip route | grep "^default " | head -n 1) initcwnd 46 initrwnd 46
ip route | while read p; do `echo ip route change $p initcwnd 10 initrwnd 10`; done
46 이 괜찮은듯