diff options
author | wollman <wollman@FreeBSD.org> | 1996-01-05 21:41:54 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1996-01-05 21:41:54 +0000 |
commit | 5d8adcbf4e291724a2348beb88b94c9948ea4289 (patch) | |
tree | b9e58f8fc85ba8b24e41e3198e210deeb5baca5a /sys/kern/uipc_socket2.c | |
parent | 9e6f88883f9f6cc358f531eb8478a92f4d4291fc (diff) | |
download | FreeBSD-src-5d8adcbf4e291724a2348beb88b94c9948ea4289.zip FreeBSD-src-5d8adcbf4e291724a2348beb88b94c9948ea4289.tar.gz |
Eliminate the dramatic TCP performance decrease observed for writes in
the range [210:260] by sweeping the problem under the rug. This change
has the following effects:
1) A new MIB variable in the kern branch is defined to allow modification
of the socket buffer layer's ``wastage factor'' (which determines how
much unused-but-allocated space in mbufs and mbuf clusters is allowed
in a socket buffer).
2) The default value of the wastage factor is changed from 2 to 8.
The original value was chosen when MINCLSIZE was 7*MLEN (!), and is not
appropriate for an environment where MINCLSIZE is much less.
The real solution to this problem is to scrap both mbufs and sockbufs
and completely redesign the buffering mechanism used at both levels.
Diffstat (limited to 'sys/kern/uipc_socket2.c')
-rw-r--r-- | sys/kern/uipc_socket2.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index 0b49f53..725dc3a 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93 - * $Id: uipc_socket2.c,v 1.6 1995/11/03 18:33:46 wollman Exp $ + * $Id: uipc_socket2.c,v 1.7 1995/12/14 22:51:02 bde Exp $ */ #include <sys/param.h> @@ -56,6 +56,10 @@ u_long sb_max = SB_MAX; /* XXX should be static */ SYSCTL_INT(_kern, KERN_MAXSOCKBUF, maxsockbuf, CTLFLAG_RW, &sb_max, 0, "") +static u_long sb_efficiency = 8; /* parameter for sbreserve() */ +SYSCTL_INT(_kern, OID_AUTO, sockbuf_waste_factor, CTLFLAG_RW, &sb_efficiency, + 0, ""); + /* * Procedures to manipulate state flags of socket * and do appropriate wakeups. Normal sequence from the @@ -396,7 +400,7 @@ sbreserve(sb, cc) if (cc > sb_max * MCLBYTES / (MSIZE + MCLBYTES)) return (0); sb->sb_hiwat = cc; - sb->sb_mbmax = min(cc * 2, sb_max); + sb->sb_mbmax = min(cc * sb_efficiency, sb_max); if (sb->sb_lowat > sb->sb_hiwat) sb->sb_lowat = sb->sb_hiwat; return (1); |