From owner-freebsd-questions Fri Aug 1 04:19:41 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id EAA14578 for questions-outgoing; Fri, 1 Aug 1997 04:19:41 -0700 (PDT) Received: from implode.root.com (implode.root.com [198.145.90.17]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id EAA14571 for ; Fri, 1 Aug 1997 04:19:37 -0700 (PDT) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.5/8.8.5) with ESMTP id EAA10693; Fri, 1 Aug 1997 04:20:21 -0700 (PDT) Message-Id: <199708011120.EAA10693@implode.root.com> To: Doug White cc: rajesha , questions@FreeBSD.ORG Subject: Re: number of socket connections In-reply-to: Your message of "Fri, 01 Aug 1997 00:59:46 PDT." From: David Greenman Reply-To: dg@root.com Date: Fri, 01 Aug 1997 04:20:20 -0700 Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >On Wed, 30 Jul 1997, rajesha wrote: > >> When doing socket programming, what is the maximum socket connections that >> can be made in UNIX in FreeBSD: 128 or 255? I looked in the sys/socket.h >> header file and it had a define of 'SOMAXCONN' as 128. >> > >This is defined as a kernel sysctl variable 'kern.somaxconn.' The default >is 128 there. > >$ sysctl -a | grep somaxconn >kern.somaxconn: 128 somaxconn/SOMAXCONN is for limiting the number of unaccepted connections - in other words, those connections for which an accept() hasn't yet been made. It puts in upper limit on the "backlog" parameter to the listen() syscall. somaxconn does NOT limit the total number of socket connections. The only limit there would be caused by exceeding the global open file limit (kern.maxfiles), or perhaps more indirectly, exceeding the maximum number of networking buffers in the system. -DG David Greenman Core-team/Principal Architect, The FreeBSD Project