summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-07-31 22:51:22 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-07-31 22:51:22 +0000
commitc126316b9f621ca511d3b459fdf2a57e33b07d14 (patch)
tree5766b40eda6296cb6d9ffd30dc19d604aa7f3873
parent5b58a3262351878eb317dbe44f2b1b5a6d444752 (diff)
downloadpfsense-c126316b9f621ca511d3b459fdf2a57e33b07d14.zip
pfsense-c126316b9f621ca511d3b459fdf2a57e33b07d14.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
-rwxr-xr-xetc/rc.bootup9
1 files changed, 9 insertions, 0 deletions
diff --git a/etc/rc.bootup b/etc/rc.bootup
index 5ddee15..1fd2366 100755
--- a/etc/rc.bootup
+++ b/etc/rc.bootup
@@ -312,6 +312,15 @@
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();
/* done */
OpenPOWER on IntegriCloud