From: Matthew Dillon Date: Tue, 10 Nov 2015 00:21:14 +0000 (-0800) Subject: kernel - Improve tcp starting window X-Git-Tag: v4.5.0~126 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/5353fab65372e67d7adbd6c4a78c2479399fff26 kernel - Improve tcp starting window * The tcp sender inflight management was forcing a starting window that was way too small for international connections, causing a bulk fetch to take several seconds to ramp up. This management is enabled by default. * Add net.inet.tcp.inflight_start to set the starting window and set the default to something more reasonable, 33792. Inflight management previously used net.inet.tcp.inflight_min as the starting value, which was 6144 and way too small. * This will significantly improve the performance of small fetches, e.g. pkg install's, update's, and upgrades, and the performance of small web server fetches occuring over high latency connections. Reported-by: tuxillo --- diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index f7356da5d3..15eae3813c 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -231,6 +231,17 @@ static int tcp_inflight_debug = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, inflight_debug, CTLFLAG_RW, &tcp_inflight_debug, 0, "Debug TCP inflight calculations"); +/* + * NOTE: tcp_inflight_start is essentially the starting receive window + * for a connection. If set too low then fetches over tcp + * connections will take noticably longer to ramp-up over + * high-latency connections. 6144 is too low for a default, + * use something more reasonable. + */ +static int tcp_inflight_start = 33792; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, inflight_start, CTLFLAG_RW, + &tcp_inflight_start, 0, "Start value for TCP inflight window"); + static int tcp_inflight_min = 6144; SYSCTL_INT(_net_inet_tcp, OID_AUTO, inflight_min, CTLFLAG_RW, &tcp_inflight_min, 0, "Lower bound for TCP inflight window"); @@ -1961,7 +1972,7 @@ tcp_xmit_bandwidth_limit(struct tcpcb *tp, tcp_seq ack_seq) tp->t_bw_rtttime = save_ticks; tp->t_bw_rtseq = ack_seq; if (tp->snd_bandwidth == 0) - tp->snd_bandwidth = tcp_inflight_min; + tp->snd_bandwidth = tcp_inflight_start; return; }