summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_timewait.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2006-04-04 14:31:37 +0000
committerglebius <glebius@FreeBSD.org>2006-04-04 14:31:37 +0000
commitcea41af9a0c8d6a0877d8cb4c7738fb8032b0e17 (patch)
treede3f80e9306cdf14aec99021ec677b8df8ea7ee2 /sys/netinet/tcp_timewait.c
parentaa27ccbc946387f4e550bb308803c93012b073bc (diff)
downloadFreeBSD-src-cea41af9a0c8d6a0877d8cb4c7738fb8032b0e17.zip
FreeBSD-src-cea41af9a0c8d6a0877d8cb4c7738fb8032b0e17.tar.gz
Add a tunable net.inet.tcp.maxtcptw, that allows to set a limit
on tcptw zone independently from setting a limit on socket zone.
Diffstat (limited to 'sys/netinet/tcp_timewait.c')
-rw-r--r--sys/netinet/tcp_timewait.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index 465b958..a6e6ab8 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -177,6 +177,10 @@ static int tcp_isn_reseed_interval = 0;
SYSCTL_INT(_net_inet_tcp, OID_AUTO, isn_reseed_interval, CTLFLAG_RW,
&tcp_isn_reseed_interval, 0, "Seconds between reseeding of ISN secret");
+static int maxtcptw;
+SYSCTL_INT(_net_inet_tcp, OID_AUTO, maxtcptw, CTLFLAG_RDTUN,
+ &maxtcptw, 0, "Maximum number of compressed TCP TIME_WAIT entries");
+
/*
* TCP bandwidth limiting sysctls. Note that the default lower bound of
* 1024 exists only for debugging. A good production default would be
@@ -290,9 +294,12 @@ tcp_init(void)
tcpcb_zone = uma_zcreate("tcpcb", sizeof(struct tcpcb_mem),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
uma_zone_set_max(tcpcb_zone, maxsockets);
+ TUNABLE_INT_FETCH("net.inet.tcp.maxtcptw", &maxtcptw);
+ if (maxtcptw == 0)
+ maxtcptw = maxsockets / 5;
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 / 5);
+ uma_zone_set_max(tcptw_zone, maxtcptw);
tcp_timer_init();
syncache_init();
tcp_hc_init();
OpenPOWER on IntegriCloud