Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Aug 2011 09:20:14 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r225169 - in head/sys: kern netinet sys
Message-ID:  <201108250920.p7P9KECb095791@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Thu Aug 25 09:20:13 2011
New Revision: 225169
URL: http://svn.freebsd.org/changeset/base/225169

Log:
  Increase the defaults for the maximum socket buffer limit,
  and the maximum TCP send and receive buffer limits from 256kB
  to 2MB.
  
  For sb_max_adj we need to add the cast as already used in the sysctl
  handler to not overflow the type doing the maths.
  
  Note that this is just the defaults.  They will allow more memory
  to be consumed per socket/connection if needed but not change the
  default "idle" memory consumption.   All values are still tunable
  by sysctls.
  
  Suggested by:	gnn
  Discussed on:	arch (Mar and Aug 2011)
  MFC after:	3 weeks
  Approved by:	re (kib)

Modified:
  head/sys/kern/uipc_sockbuf.c
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_output.c
  head/sys/sys/sockbuf.h

Modified: head/sys/kern/uipc_sockbuf.c
==============================================================================
--- head/sys/kern/uipc_sockbuf.c	Thu Aug 25 08:47:38 2011	(r225168)
+++ head/sys/kern/uipc_sockbuf.c	Thu Aug 25 09:20:13 2011	(r225169)
@@ -61,7 +61,7 @@ void	(*aio_swake)(struct socket *, struc
 
 u_long	sb_max = SB_MAX;
 u_long sb_max_adj =
-       SB_MAX * MCLBYTES / (MSIZE + MCLBYTES); /* adjusted sb_max */
+       (quad_t)SB_MAX * MCLBYTES / (MSIZE + MCLBYTES); /* adjusted sb_max */
 
 static	u_long sb_efficiency = 8;	/* parameter for sbreserve() */
 

Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c	Thu Aug 25 08:47:38 2011	(r225168)
+++ head/sys/netinet/tcp_input.c	Thu Aug 25 09:20:13 2011	(r225169)
@@ -195,7 +195,7 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO,
     &VNET_NAME(tcp_autorcvbuf_inc), 0,
     "Incrementor step size of automatic receive buffer");
 
-VNET_DEFINE(int, tcp_autorcvbuf_max) = 256*1024;
+VNET_DEFINE(int, tcp_autorcvbuf_max) = 2*1024*1024;
 #define	V_tcp_autorcvbuf_max	VNET(tcp_autorcvbuf_max)
 SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, recvbuf_max, CTLFLAG_RW,
     &VNET_NAME(tcp_autorcvbuf_max), 0,

Modified: head/sys/netinet/tcp_output.c
==============================================================================
--- head/sys/netinet/tcp_output.c	Thu Aug 25 08:47:38 2011	(r225168)
+++ head/sys/netinet/tcp_output.c	Thu Aug 25 09:20:13 2011	(r225169)
@@ -117,7 +117,7 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO,
 	&VNET_NAME(tcp_autosndbuf_inc), 0,
 	"Incrementor step size of automatic send buffer");
 
-VNET_DEFINE(int, tcp_autosndbuf_max) = 256*1024;
+VNET_DEFINE(int, tcp_autosndbuf_max) = 2*1024*1024;
 #define	V_tcp_autosndbuf_max	VNET(tcp_autosndbuf_max)
 SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, sendbuf_max, CTLFLAG_RW,
 	&VNET_NAME(tcp_autosndbuf_max), 0,

Modified: head/sys/sys/sockbuf.h
==============================================================================
--- head/sys/sys/sockbuf.h	Thu Aug 25 08:47:38 2011	(r225168)
+++ head/sys/sys/sockbuf.h	Thu Aug 25 09:20:13 2011	(r225169)
@@ -37,7 +37,7 @@
 #include <sys/_mutex.h>
 #include <sys/_sx.h>
 
-#define	SB_MAX		(256*1024)	/* default for max chars in sockbuf */
+#define	SB_MAX		(2*1024*1024)	/* default for max chars in sockbuf */
 
 /*
  * Constants for sb_flags field of struct sockbuf.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108250920.p7P9KECb095791>