netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] socket: increase default maximum listen queue length
@ 2011-03-25 18:31 Hagen Paul Pfeifer
  2011-03-25 18:31 ` [PATCH 2/2] socket: add minimum listen queue length sysctl Hagen Paul Pfeifer
  2011-03-31  5:52 ` [PATCH 1/2] socket: increase default maximum listen queue length David Miller
  0 siblings, 2 replies; 9+ messages in thread
From: Hagen Paul Pfeifer @ 2011-03-25 18:31 UTC (permalink / raw)
  To: netdev; +Cc: Eric Dumazet

sysctl_somaxconn specifies the maximum number of sockets in state
SYN_RECV per listen socket and is initialized with 128 (SOMAXCONN).

sysctl_max_syn_backlog on the other hand provides similar functionality:
provides a system wide upper limit of request sockets per listen socket.
But sysctl_max_syn_backlog provides a more accurate value by considerate
the actual memory situation of the system. 256 by default, 128 for
systems with low memory and up to 1024 for larger systems.

This patch increase sysctl_somaxconn to 256 and provide environments with
a increased RTT and many connections/second a better default value by
simultaneously provides the fallback that smaller systems will not suffer
of an increased memory usage - sysctl_max_syn_backlog is already a good
guard.

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
---
 include/linux/socket.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/socket.h b/include/linux/socket.h
index edbb1d0..bf35ce2 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -237,7 +237,7 @@ struct ucred {
 #define PF_MAX		AF_MAX
 
 /* Maximum queue length specifiable by listen.  */
-#define SOMAXCONN	128
+#define SOMAXCONN	256
 
 /* Flags we can use with send/ and recv. 
    Added those for 1003.1g not all are supported yet
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread
* Re: [PATCH] socket: increase default maximum listen queue length
@ 2011-03-20 12:14 Hagen Paul Pfeifer
  2011-03-20 23:04 ` [PATCH 1/2] " Hagen Paul Pfeifer
  0 siblings, 1 reply; 9+ messages in thread
From: Hagen Paul Pfeifer @ 2011-03-20 12:14 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev

* Eric Dumazet | 2011-03-20 12:55:44 [+0100]:

>I am not sure you understood what I said.
>
>Even if you change kernel limits, many applications still use low
>limits : listen(fd, 8)

Right, but there is a discrepance between system administrators and server
authors: the later group will probably notice that listen(fd, 8) is not
adequate (e.g. someone send a bug report). System administrators on the other
hand have no obvious indicator that some goes wrong in the system. Most of
then would not even notice that the backlog is overflowing. 

>I remember some other OS (was it HPUX or Solaris...) had a minimum
>limit : Even if application said 8, an admin could impose a 256 value
>for example.

Not the baddest idea! It is nice that a server author can adjust that value.
But between you and me: the system administrator may have more information
about the network behavior (how many incoming connections/minute, RTT, memory
characteristic, ...). The system administrator should be in the ability to
increase the value, currently he is stucked up if the server author missed
that. E.g.

http://www.dovecot.org/list/dovecot-cvs/2009-September/014567.html

I will spin a patch for that.

Hagen

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-03-31  5:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-25 18:31 [PATCH 1/2] socket: increase default maximum listen queue length Hagen Paul Pfeifer
2011-03-25 18:31 ` [PATCH 2/2] socket: add minimum listen queue length sysctl Hagen Paul Pfeifer
2011-03-25 20:24   ` Rick Jones
2011-03-25 23:51     ` Hagen Paul Pfeifer
2011-03-26  0:21       ` Rick Jones
2011-03-26  7:06       ` Eric Dumazet
2011-03-31  5:52 ` [PATCH 1/2] socket: increase default maximum listen queue length David Miller
  -- strict thread matches above, loose matches on Subject: below --
2011-03-20 12:14 [PATCH] " Hagen Paul Pfeifer
2011-03-20 23:04 ` [PATCH 1/2] " Hagen Paul Pfeifer
2011-03-20 23:04   ` [PATCH 2/2] socket: add minimum listen queue length sysctl Hagen Paul Pfeifer
2011-03-21  7:36     ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).