From owner-freebsd-current@FreeBSD.ORG Wed Jan 4 21:03:30 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CF6C1065670 for ; Wed, 4 Jan 2012 21:03:30 +0000 (UTC) (envelope-from dan@sunsaturn.com) Received: from sunsaturn.com (mail1.sunsaturn.com [IPv6:2001:49f0:4004::2]) by mx1.freebsd.org (Postfix) with ESMTP id 433988FC1E for ; Wed, 4 Jan 2012 21:03:30 +0000 (UTC) Received: by sunsaturn.com (Postfix, from userid 1001) id D54A8119C6E; Wed, 4 Jan 2012 15:03:29 -0600 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=sunsaturn.com; s=gamma; t=1325711009; bh=hPNaYyxSqq5Gz5dD4C1KOBUJTYNyxizZ2eSAQ6MYDYc=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=pThKlcwAapt7SOQGvPUNrkiyAZJlXKkut7uquOnLYSkkqFSjkF3FeB0UKAH8s+H3/ WBYpTfElwiI2oXmTAZwap/55nGqiO8KHp6D15D8INIrGZJCQ1+G3a7tDZ33Ly1E9xr 5O5g0RQFusM6UhPXtPE2XjhlWXbl5zlYdoJWnD7E= Received: from localhost (localhost [127.0.0.1]) by sunsaturn.com (Postfix) with ESMTP id CF732119C56; Wed, 4 Jan 2012 15:03:29 -0600 (CST) Date: Wed, 4 Jan 2012 15:03:29 -0600 (CST) From: Dan The Man To: Chuck Swiger In-Reply-To: <52A4B11E-592E-458D-BA0F-9B5A349F4B73@mac.com> Message-ID: References: <0A9B7C39-DFA9-4C65-BE39-CC72E18DAB87@mac.com> <52A4B11E-592E-458D-BA0F-9B5A349F4B73@mac.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-current@freebsd.org Subject: Re: sysctl kern.ipc.somaxconn limit 65535 why? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 21:03:30 -0000 On Wed, 4 Jan 2012, Chuck Swiger wrote: > On Jan 4, 2012, at 12:44 PM, Dan The Man wrote: >>> Even a backlog of a 1000 is large compared to the default listen queue size of around 50 or 128. And if you can drain 1000 connections per second, a 65K backlog is big enough that plenty of clients (I'm thinking web-browsers here in particular) will have given up and maybe retried rather than waiting for 60+ seconds just to exchange data. >> >> For web browsers makes sense, but if your coding your own server application its only a matter of increasing the read and write timeouts >> to fill queue that high and still process them. > > Sure, agreed. > >> Of course wouldn't need anything that high, but for benchmarking how much can toss in that listen queue then write something to socket on each one after connection established to see how fast application can finish them all, I think its relevant. >> >> This linux box I have no issues: >> cappy:~# /sbin/sysctl -w net.core.somaxconn=200000 >> net.core.somaxconn = 200000 >> cappy:~# sysctl -w net.ipv4.tcp_max_syn_backlog=20000 >> net.ipv4.tcp_max_syn_backlog = 200000 >> cappy:~# > > However, I'm not convinced that it is useful to do this. At some point, you are better off timing out and retrying via exponential backoff than you are queuing hundreds of thousands of connections in the hopes that they will eventually be serviced by something sometime considerably later. > I agree completely, in practical application this makes sense, but why should the OS dictate not being able to temporarily set that setting higher in order to fully benchmark the application at 100k+ in the listen queue if the developer so chooses? I think that alone should be a good reason, to make freebsd developer friendly. Dan. -- Dan The Man CTO/ Senior System Administrator Websites, Domains and Everything else http://www.SunSaturn.com Email: Dan@SunSaturn.com