Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Sep 1995 18:38:34 -0700
From:      David Greenman <davidg@Root.COM>
To:        Aaron Gifford <agifford@infowest.com>
Cc:        questions@freebsd.org
Subject:   Re: SOMAXCONN question 
Message-ID:  <199509130138.SAA00441@corbin.Root.COM>
In-Reply-To: Your message of "Tue, 12 Sep 95 19:15:49 -0601." <199509130116.TAA02403@InfoWest.COM> 

next in thread | previous in thread | raw e-mail | index | archive | help
>I was wondering what would happen if I bumped up the value of SOMAXCONN
>from 5 to 15 in <sys/socket.h> and in /usr/src/sys/sys/socket.h and then
>recompiled my kernel...  Would it break something?  Also, would it fix
>a problem I've noticed on my web server...  when someone begins to connect
>over a SLOW or bad link, sometimes `netstat -an | grep SYN_RCVD` shows
>that person's multiple connections remaining in the SYN_RCVD state for
>quite a while, which appears to make it impossible for anyone else to
>connect to the web server until some slots clear.  Not being much of
>a socket hacker and not knowing the kernel, I assumed that the listen(sock,max)
>queue was full, and that SOMAXCONN was a limiting factor.

   It should fix your problem. It's interesting that you should send this
email - this very subject was the topic between myself and several people
yesterday. ...for instance, I can tell you that www.intel.com now has
SOMAXCONN set to 120 (as of yesterday)...although I think this is much higher
than is actually needed. I suspect that a number in the 10-20 range should be
adequate. Last night I was going to add a counter to count the number of
connection requests that were dropped because of the queue limit, but got
sidetracked...
   BTW, you'll likely have to recompile your web server, too, if it has a
small value specified in the listen() call (it's apparantly common to specify
SOMAXCONN, which of course would be 5 when it was compiled).

-DG



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