ssh over WAN: TCP window too small

Chris Stankevitz chris at stankevitz.com
Fri Aug 28 19:14:33 UTC 2015


On 8/27/15 6:14 AM, Kurt Lidl wrote:
> # tcp options for long-haul speedups
> kern.ipc.maxsockbuf=4194304             # (2 * default 2097152)
> net.inet.tcp.mssdflt=1448               # (default 576)
> net.inet.tcp.sendbuf_max=4194304        # (2 * default 2097152)
> net.inet.tcp.recvbuf_max=4194304        # (2 * default 2097152)
>
> net.inet.tcp.syncache.rexmtlimit=1      # (default 3)
> net.inet.tcp.recvspace=262144           # (4 * default 65,536)
> net.inet.tcp.sendspace=262144           # (4 * default 65,536)
>
> net.inet.tcp.sendbuf_inc=65536          # (8 * default 8192)
> net.inet.tcp.recvbuf_inc=131072         # (8 * default 16384)


Kurt,

Thank you.  FYI the default for sendspace is 32768 (not 65536).

With these parameters my S-BCNT increases from ~60K to ~200K when doing 
`ssh < /dev/zero`.  Amusingly, something somewhere limits 
bytes-in-flight to 172,888 bytes (I believe the ssh sending client is 
limiting -- although I'm not sure why).  This effectively caps my 
bandwidth to 20 Mbps.

With iperf this limitation does not exist -- nor does the need to tune 
these values (except for buf_inc which can get the ball rolling faster 
as you pointed out).

Chris


More information about the freebsd-net mailing list