From: Sepherosa Ziehau Date: Mon, 30 Jul 2012 06:36:52 +0000 (+0800) Subject: tcp: Increase tcp_sosend_agglim from 2 to 3 X-Git-Tag: v3.2.0~507 X-Git-Url: http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/b3f7971467e0ce7934443aab946e11396d9f78e6 tcp: Increase tcp_sosend_agglim from 2 to 3 This change makes better use of TSO. When 2 is used, most of the large TCP segments' size are 2*MSS or 3*MSS. When 3 is used, most of the large TCP segments' size are 4*MSS or 5*MSS. The math is quite simple, given 1448B segment size: 2 == 4096B == 2 segments 3 == 6144B == 4 segments Increasing it to a higher value improves single full speed stream's CPU utilization, but does not have much effect on multiple streams'. --- diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 81fb6fc..dd906b5 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -249,7 +249,7 @@ int tcp_autorcvbuf_max = 2*1024*1024; SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_max, CTLFLAG_RW, &tcp_autorcvbuf_max, 0, "Max size of automatic receive buffer"); -int tcp_sosend_agglim = 2; +int tcp_sosend_agglim = 3; SYSCTL_INT(_net_inet_tcp, OID_AUTO, sosend_agglim, CTLFLAG_RW, &tcp_sosend_agglim, 0, "TCP sosend mbuf aggregation limit");