public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] increase listen backlog (sunrpc)
@ 2005-01-11 11:06 Thorsten Kukuk
  0 siblings, 0 replies; only message in thread
From: Thorsten Kukuk @ 2005-01-11 11:06 UTC (permalink / raw)
  To: libc-hacker


Hi,

The default listen backlog in sunrpc/svc_tcp.c and sunrpc/svc_unix.c
is too small for modern servers. Here is a fix (which is similar to
the solution from TI-RPC and all *BSD ports do) to increase the
performance. We use it already since some time for SuSE Linux.

2005-01-11  Thorsten Kukuk  <kukuk@suse.de>

	* sunrpc/svc_tcp.c (svctcp_create): Call listen with SOMAXCONN
	as backlog.
	* sunrpc/svc_unix.c (svcunix_create): Likewise.

--- sunrpc/svc_tcp.c
+++ sunrpc/svc_tcp.c	2004/06/14 16:50:52
@@ -165,7 +165,7 @@
       (void) __bind (sock, (struct sockaddr *) &addr, len);
     }
   if ((__getsockname (sock, (struct sockaddr *) &addr, &len) != 0) ||
-      (__listen (sock, 2) != 0))
+      (__listen (sock, SOMAXCONN) != 0))
     {
       perror (_("svc_tcp.c - cannot getsockname or listen"));
       if (madesock)
--- sunrpc/svc_unix.c
+++ sunrpc/svc_unix.c	2004/06/14 16:51:00
@@ -161,7 +161,7 @@
   __bind (sock, (struct sockaddr *) &addr, len);
 
   if (__getsockname (sock, (struct sockaddr *) &addr, &len) != 0
-      || __listen (sock, 2) != 0)
+      || __listen (sock, SOMAXCONN) != 0)
     {
       perror (_("svc_unix.c - cannot getsockname or listen"));
       if (madesock)

-- 
Thorsten Kukuk         http://www.suse.de/~kukuk/      kukuk@suse.de
SuSE Linux Products GmbH       Maxfeldstr. 5       D-90409 Nuernberg
--------------------------------------------------------------------    
Key fingerprint = A368 676B 5E1B 3E46 CFCE  2D97 F8FD 4E23 56C6 FB4B

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-01-11 11:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-11 11:06 [PATCH] increase listen backlog (sunrpc) Thorsten Kukuk

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 read-only IMAP folder(s) and NNTP newsgroup(s).