diff options
author | bz <bz@FreeBSD.org> | 2011-08-25 09:20:13 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2011-08-25 09:20:13 +0000 |
commit | 860d2aa85df1d35491870df7bf0b51f97fe69848 (patch) | |
tree | e9be85bb6767dd706449cec9e576bcc8bbd6d21a /sys | |
parent | d491106e41e82491cb69f865172f26c93efad73b (diff) | |
download | FreeBSD-src-860d2aa85df1d35491870df7bf0b51f97fe69848.zip FreeBSD-src-860d2aa85df1d35491870df7bf0b51f97fe69848.tar.gz |
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)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/uipc_sockbuf.c | 2 | ||||
-rw-r--r-- | sys/netinet/tcp_input.c | 2 | ||||
-rw-r--r-- | sys/netinet/tcp_output.c | 2 | ||||
-rw-r--r-- | sys/sys/sockbuf.h | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index 2d86d74..551afac 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -61,7 +61,7 @@ void (*aio_swake)(struct socket *, struct sockbuf *); 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() */ diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 7f06bd4..b1a8b33 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -195,7 +195,7 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, recvbuf_inc, CTLFLAG_RW, &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, diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 572a491..702eed3 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -117,7 +117,7 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, sendbuf_inc, CTLFLAG_RW, &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, diff --git a/sys/sys/sockbuf.h b/sys/sys/sockbuf.h index b8e6699..bfccd74 100644 --- a/sys/sys/sockbuf.h +++ b/sys/sys/sockbuf.h @@ -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. |