From owner-freebsd-hackers Sun Aug 3 10:25:38 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id KAA03806 for hackers-outgoing; Sun, 3 Aug 1997 10:25:38 -0700 (PDT) Received: from scanner.worldgate.com (scanner.worldgate.com [198.161.84.3]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id KAA03799 for ; Sun, 3 Aug 1997 10:25:35 -0700 (PDT) Received: from znep.com (uucp@localhost) by scanner.worldgate.com (8.8.5/8.8.5) with UUCP id LAA22377; Sun, 3 Aug 1997 11:25:32 -0600 (MDT) Received: from localhost (marcs@localhost) by alive.znep.com (8.7.5/8.7.3) with SMTP id LAA18997; Sun, 3 Aug 1997 11:26:42 -0600 (MDT) Date: Sun, 3 Aug 1997 11:26:41 -0600 (MDT) From: Marc Slemko To: "Andrew N. Edmond" cc: hackers@FreeBSD.ORG Subject: Re: Too many open files in System! In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Sun, 3 Aug 1997, Andrew N. Edmond wrote: > I am writing a multithreaded application (using MIT pthreads 1.6) that > MUST have thousands of open files, and nearly 4000 open sockets. I'm > getting this error when I try to accept on this many sockets: > > error on accept: Too many open files in system > > I set CHILD_MAX and OPEN_MAX to 4098 in the kernel, and I can't find a way > to get accept to open any more sockets. Any ideas? You say you need 4000 sockets and thousands of files. That adds up to >4098 descriptors. Have you tried increasing CHILD_MAX beyond 4098? Well, you can just do a sysctl to change kern.maxfiles and kern.maxfilesperproc which should have the same effect. Then check your ulimit -n and increase it if necessary, eg. $ su # ulimit -Hn unlimited # ulimit -n unlimited # ulimit -n and be sure it is high enough. What version is this on? Any sample minimal source code to demonstrate the problem you are having?