Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 04 Sep 1996 05:17:23 -0700
From:      David Greenman <dg@root.com>
To:        Tom Samplonius <tom@sdf.com>
Cc:        hackers@freebsd.org
Subject:   Re: Impact of large listen() queue 
Message-ID:  <199609041217.FAA00762@root.com>
In-Reply-To: Your message of "Tue, 03 Sep 1996 21:48:22 PDT." <Pine.NEB.3.94.960903214335.10629A-100000@misery.sdf.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
>  What is the impact of using a large value (>100) for the backlog param
>to listen()?  Does it impact performance?  I assume that it eats some kind
>of kernel memory space, so how much?
>
>  I know there is an old standard of a maximum of 5 for the backlog param.
>But most modern systems can handle much large values.  Is there any
>disadvantage to using the maximum value (I believe under FreeBSD, this is
>255) all the time?

   The backlog parameter to listen() is limited in the kernel to SOMAXCONN,
which in recent versions of FreeBSD (including 2.1.5) is 128. Specifying the
listen() parameter higher than this will do nothing - it will be restricted
to 128.
   The disadvantage of using a large value is that you can end up with a (too)
large number of connections backlogged, and these consume kernel resources.
The kernel drops new connection requests when the limit is reached,
intentionally, in order to throttle the load a bit. It's rarely necessary to
use a limit greater than about 60 or 70, and only in rare cases is it useful
to use a limit greater than 100. The maximum value of 128 in FreeBSD was
chosen to reflect a practical 'maximum'...unlike 5 (or 10) which is almost
always impractical even as a default.

-DG

David Greenman
Core-team/Principal Architect, The FreeBSD Project



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