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.
This commit is contained in:
parent
f47392f4c2
commit
0709c23335
@ -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();
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user