Change TCPTV_MIN to be independent of HZ. While it was documented to
be in ticks "for algorithm stability" when originally committed, it turns out that it has a significant impact in timing out connections. When we changed HZ from 100 to 1000, this had a big effect on reducing the time before dropping connections. To demonstrate, boot with kern.hz=100. ssh to a box on local ethernet and establish a reliable round-trip-time (ie: type a few commands). Then unplug the ethernet and press a key. Time how long it takes to drop the connection. The old behavior (with hz=100) caused the connection to typically drop between 90 and 110 seconds of getting no response. Now boot with kern.hz=1000 (default). The same test causes the ssh session to drop after just 9-10 seconds. This is a big deal on a wifi connection. With kern.hz=1000, change sysctl net.inet.tcp.rexmit_min from 3 to 30. Note how it behaves the same as when HZ was 100. Also, note that when booting with hz=100, net.inet.tcp.rexmit_min *used* to be 30. This commit changes TCPTV_MIN to be scaled with hz. rexmit_min should always be about 30. If you set hz to Really Slow(TM), there is a safety feature to prevent a value of 0 being used. This may be revised in the future, but for the time being, it restores the old, pre-hz=1000 behavior, which is significantly less annoying. As a workaround, to avoid rebooting or rebuilding a kernel, you can run "sysctl net.inet.tcp.rexmit_min=30" and add "net.inet.tcp.rexmit_min=30" to /etc/sysctl.conf. This is safe to run from 6.0 onwards. Approved by: re (rwatson) Reviewed by: andre, silby
This commit is contained in:
parent
5878cbeccf
commit
c4a184bdc4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=171677
@ -259,6 +259,8 @@ tcp_init(void)
|
||||
tcp_maxpersistidle = TCPTV_KEEP_IDLE;
|
||||
tcp_msl = TCPTV_MSL;
|
||||
tcp_rexmit_min = TCPTV_MIN;
|
||||
if (tcp_rexmit_min < 1)
|
||||
tcp_rexmit_min = 1;
|
||||
tcp_rexmit_slop = TCPTV_CPU_VAR;
|
||||
tcp_inflight_rttthresh = TCPTV_INFLIGHT_RTTTHRESH;
|
||||
tcp_finwait2_timeout = TCPTV_FINWAIT2_TIMEOUT;
|
||||
|
@ -111,7 +111,7 @@
|
||||
* The prior minimum of 1*hz (1 second) badly breaks throughput on any
|
||||
* networks faster then a modem that has minor (e.g. 1%) packet loss.
|
||||
*/
|
||||
#define TCPTV_MIN ( 3 ) /* minimum allowable value */
|
||||
#define TCPTV_MIN ( hz/33 ) /* minimum allowable value */
|
||||
#define TCPTV_CPU_VAR ( hz/5 ) /* cpu variance allowed (200ms) */
|
||||
#define TCPTV_REXMTMAX ( 64*hz) /* max allowable REXMT value */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user