Re: Poor TCP performance as latency increases
Havard Eidnes <[email protected]>
| Newsgroups | gmane.os.netbsd.devel.network |
|---|---|
| Message-ID | <[email protected]> |
> It seems that there is a performance issue in the TCP stack, > and I'm hoping someone else can reproduce my findings as I'm > not an expert in this area. > > Simple test: Download a file from a web server. As latency > between the client and server increases, there is a drastic > reduction in throughput. I don't see this with other (Linux, > macOS) TCP stacks. Traditionally, NetBSD has been fairly conservative in the parameter settings for the TCP stack, meaning "not allocating too much memory". If you find that your performance scales inversely with RTT, that is probably the issue: your TCP sessions will then be "window size limited". You could test with these settings from /etc/sysctl.conf and see if they make any discernible difference: # Tuning of TCP, slightly conservative: kern.sbmax=1048576 net.inet6.tcp6.sendbuf_max=1048576 net.inet6.tcp6.recvbuf_max=1048576 net.inet.tcp.sendbuf_max=1048576 net.inet.tcp.recvbuf_max=1048576 net.inet.tcp.congctl.selected=cubic # And also bump the default receive window: net.inet.tcp.recvspace=262144 I also agree with Greg Troxel that to fully diagnose issues such as this, you ideally need pcap packet traces, and minimally at the sending side and use tcptrace + xplot to inspect the result to see if there are retransmissions (which is indicative of packet loss, which is bad for performance but is also the way the Internet works to provide feedback to the TCP flow control when there is congestion), or whether you are window-size-limited or whether there is some other issue. Regards, - Håvard