diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2007-07-31 22:51:29 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2007-07-31 22:51:29 +0000 |
commit | 4313e61a52ebf6edfebd2fef6ab7b5f595650557 (patch) | |
tree | 30a25cf170af5793ac316e9e4c33464e547edc06 /etc/rc.bootup | |
parent | 90b2b0933396aacd5d6e5ef180bbd7a992d42fdd (diff) | |
download | pfsense-4313e61a52ebf6edfebd2fef6ab7b5f595650557.zip pfsense-4313e61a52ebf6edfebd2fef6ab7b5f595650557.tar.gz |
Increase timeouts when using a 1000 hz.
From the FreeBSD commit message:
Ê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
Diffstat (limited to 'etc/rc.bootup')
-rwxr-xr-x | etc/rc.bootup | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/etc/rc.bootup b/etc/rc.bootup index 75e1590..07108d2 100755 --- a/etc/rc.bootup +++ b/etc/rc.bootup @@ -316,6 +316,15 @@ mwexec("sysctl net.inet.tcp.recvspace=4096"); mwexec("sysctl net.inet.tcp.sendspace=4096"); } + + /* if we are operating at 1000 then increase timeouts. + this was never accounted for after moving to 1000 hz */ + $kern_hz = `sysctl kern.clockrate | awk '{ print $5 }' | cut -d"," -f1`; + $kern_hz = trim($kern_hz, "\r\n"); + if($kern_hz == "1000") { + mwexec("sysctl net.inet.tcp.rexmit_min=30"); + mwexec("sysctl net.inet.tcp.rexmit_min=30"); + } upnp_start(); |