From owner-freebsd-hackers Wed Sep 4 05:16:07 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id FAA08001 for hackers-outgoing; Wed, 4 Sep 1996 05:16:07 -0700 (PDT) Received: from root.com (implode.root.com [198.145.90.17]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id FAA07996 for ; Wed, 4 Sep 1996 05:16:05 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by root.com (8.7.5/8.6.5) with SMTP id FAA00762; Wed, 4 Sep 1996 05:17:23 -0700 (PDT) Message-Id: <199609041217.FAA00762@root.com> X-Authentication-Warning: implode.root.com: Host localhost [127.0.0.1] didn't use HELO protocol To: Tom Samplonius cc: hackers@freebsd.org Subject: Re: Impact of large listen() queue In-reply-to: Your message of "Tue, 03 Sep 1996 21:48:22 PDT." From: David Greenman Reply-To: dg@root.com Date: Wed, 04 Sep 1996 05:17:23 -0700 Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > 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