From owner-freebsd-current@FreeBSD.ORG Wed Oct 3 20:06:11 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D955B106578D; Wed, 3 Oct 2012 20:06:11 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id A60118FC08; Wed, 3 Oct 2012 20:06:11 +0000 (UTC) Received: by padbi1 with SMTP id bi1so7662872pad.13 for ; Wed, 03 Oct 2012 13:06:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=ZPMuAamP7BUHTGi9jWbaC0afymLbd3LmcOcwV89d6z0=; b=JAe/VwijMruqteuxzt8r23t058Gx4o43Sq63cuBQ0iCwaS46uVvyTpxZzFfh8to3aC TVoIxnQeAEOYWXcUAkxojaloQYR8qxTlzZrTip8E5b5H+fEBh0bLAnXV0Rw1sVpVGOxX L894qZinmp7Cd15Thw4dwMPTqKPPy/lpXBoFeXRkueu+7YP2AgqpEbSagQK1TG/eMKUa BhjIWYAnO9OONfekRP6z4cjD0Zpg0f7sm6GU1njVMOPWv7VnrsLdp2eIXh3XgW+QmgKY kJqSHTpVL6xTgdYriAo3PC9TVNEBRdyI6wNA24iCcZ7X9CanaZ/xQ6kbJ2vMJIbCpHXP zB+Q== MIME-Version: 1.0 Received: by 10.68.135.39 with SMTP id pp7mr15539022pbb.127.1349294771091; Wed, 03 Oct 2012 13:06:11 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.223.136 with HTTP; Wed, 3 Oct 2012 13:06:11 -0700 (PDT) In-Reply-To: References: <03e101cda197$326dc240$974946c0$@org> Date: Wed, 3 Oct 2012 13:06:11 -0700 X-Google-Sender-Auth: GIzcduuJrWZH3G6wSKtViFEGgA0 Message-ID: From: Adrian Chadd To: Garrett Cooper Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd@chrysalisnet.org, freebsd-current@freebsd.org, Gleb Smirnoff 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, 03 Oct 2012 20:06:12 -0000 On 3 October 2012 13:01, Garrett Cooper wrote: > > Here's where it's being held at 65535 (sys/kern/kern_uipc.c): > > 3276 static int > 3277 sysctl_somaxconn(SYSCTL_HANDLER_ARGS) > 3278 { > 3279 int error; > 3280 int val; > 3281 > 3282 val = somaxconn; > 3283 error = sysctl_handle_int(oidp, &val, 0, req); > 3284 if (error || !req->newptr ) > 3285 return (error); > 3286 > 3287 if (val < 1 || val > USHRT_MAX) > 3288 return (EINVAL); > 3289 > > More details about the need for this limit are in > http://svnweb.freebsd.org/base?view=revision&revision=140730 . > > It looks like this needs to be enhanced to support more than > USHRT_MAX, which will require socket structure changes and other fun > things, but should be possible... I've CCed glebius for comment on > this. Again, somaxconn is _not the number of sockets_. It's the backlog allowed in the incoming connection queue for a given socket. That's it. If you pass listen a backlog value of -1 or greater than somaxconn, then the queue depth gets pinned at somaxconn. There's something else going on.. Adrian