*BSD News Article 51692


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!news.sprintlink.net!howland.reston.ans.net!swrinde!sgigate.sgi.com!news1.best.com!shellx.best.com!blob.best.net!not-for-mail
From: dillon@best.com (Matt Dillon)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Where is tcp/ip backlog parameter set in source?
Date: 19 Sep 1995 21:49:51 -0700
Organization: Best Internet Communications, Inc. (info@best.com)
Lines: 41
Distribution: best
Message-ID: <43o6hf$7q5@blob.best.net>
References: <JOE.95Sep15193428@ns.via.net> <43g6l7$2tl@reason.cdrom.com>
NNTP-Posting-Host: blob.best.net

:In article <43g6l7$2tl@reason.cdrom.com>,
:Jordan K. Hubbard <jkh@FreeBSD.org> wrote:
:>joe@ns.via.net (Joe McGuckin) wrote:
:>>I was reading a tech report from Sun that mentioned that one way to 
:>>increase the performance of web servers was to increase the default size
:>>of the backlog value (currently hard set to 5) used in the listen() system 
:>>call.
:>
:>Hmmmmm..  Looks to be /usr/src/sys/kern/uipc_socket.c.  Our backlog is set
:>here:
:>	/sys/sys/socket.h:#define       SOMAXCONN       32
:>
:>I agree that this should be a MIB variable, tweakable with sysctl...  I'll
:>look into it.
:>-- 
:>						Jordan

    This brings back memories.

    I tweaked that baby up to 256 months ago, and just recently
    bumped it even more... to 4096 for the web server, which has an
    average of 30 incoming connections in SYN_RCVD at any given moment.
    The tweak up to 4096 (along with the associated change to the listen()
    call in the server) is to handle internet outages... when MCI or Sprint
    goes on the fritz, it tends to build up a couple of hundred half-way
    broken connections on the WWW port, and a few dozen on the SMTP port.

    Once the queue is filled up, legitimate connections are ignored.  Thus
    an outage on the internet could effect local access to the server.

    I don't remember if the #ifndef SOMAXCONN/#endif surrounding that #define
    in /sys/sys/socket.h was something I added or whether it was there already,
    but my solution was to surround it with such and then use it as a 
    configuration option (/sys/i386/conf/*).

						-Matt

-- 
    Matthew Dillon   VP Engineering, BEST Internet Communications, Inc.
		    <dillon@best.com>, <dillon@apollo.west.oic.com>
    [always include a portion of the original email in any response!]