summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_subr.c
diff options
context:
space:
mode:
authorsilby <silby@FreeBSD.org>2003-10-24 05:44:14 +0000
committersilby <silby@FreeBSD.org>2003-10-24 05:44:14 +0000
commit4390f0545904e8fe638e4fbb365000ec229a7c3a (patch)
treefb1b0677457cd015641c4e2b20a0e8f30936c317 /sys/netinet/tcp_subr.c
parent05b0056432194711845d7ed2d787081ed3c8c18d (diff)
downloadFreeBSD-src-4390f0545904e8fe638e4fbb365000ec229a7c3a.zip
FreeBSD-src-4390f0545904e8fe638e4fbb365000ec229a7c3a.tar.gz
Reduce the number of tcp time_wait structs to maxsockets / 5; this ensures
that at most 20% of sockets can be in time_wait at one time, ensuring that time_wait sockets do not starve real connections from inpcb structures. No implementation change is needed, jlemon already implemented a nice LRU-ish algorithm for tcp_tw structure recycling. This should reduce the need for sysadmins to lower the default msl on busy servers.
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r--sys/netinet/tcp_subr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 613ea59..d2a28c8 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -259,7 +259,7 @@ tcp_init()
uma_zone_set_max(tcpcb_zone, maxsockets);
tcptw_zone = uma_zcreate("tcptw", sizeof(struct tcptw),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
- uma_zone_set_max(tcptw_zone, maxsockets);
+ uma_zone_set_max(tcptw_zone, maxsockets / 5);
tcp_timer_init();
syncache_init();
}
OpenPOWER on IntegriCloud