From owner-freebsd-hackers Fri Sep 27 12:32:01 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id MAA27105 for hackers-outgoing; Fri, 27 Sep 1996 12:32:01 -0700 (PDT) Received: from gvr.win.tue.nl (root@gvr.win.tue.nl [131.155.210.19]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id MAA27008 for ; Fri, 27 Sep 1996 12:31:54 -0700 (PDT) Received: by gvr.win.tue.nl (8.6.13/1.53) id VAA01983; Fri, 27 Sep 1996 21:31:40 +0200 From: guido@gvr.win.tue.nl (Guido van Rooij) Message-Id: <199609271931.VAA01983@gvr.win.tue.nl> Subject: Re: OPEN_MAX => which #define counts? To: bde@zeta.org.au (Bruce Evans) Date: Fri, 27 Sep 1996 21:31:39 +0200 (MET DST) Cc: hackers@FreeBSD.org, mark@quickweb.com In-Reply-To: <199609271024.UAA19546@godzilla.zeta.org.au> from Bruce Evans at "Sep 27, 96 08:24:34 pm" X-Mailer: ELM [version 2.4ME+ PL17 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk > No relation, except if OPEN_MAX is large (256 or so) and that many > files are opened by several processes, then you'll quickly run out of > system fd's. E.g., on a 16MB system, then defaults give kern.maxfiles = > 360, and kern.maxfilesperproc = 360. If OPEN_MAX or the soft rlimit > is set to 360, then one user process can eat all the system fd's, so > root won't be able to log in. This requires no special privileges. > This is broken as designed. It's easy to reduce the hard rlimit or > kern.maxfilesperproc so that a single process can't exhaust all fd's, > but the reasonable defaults of (CHILD_MAX = 40) and (OPEN_MAX = 64) > require an unreasonable number of system fd's (2560) to satisfy the > worst case. When I added maxfilesperproc, I made it default to maxfiles for backwards compatibilty. But indeed the reason for adding such a thing was to be able to at least have more control over how fd's can be spread out among processes. The same btw for maxproc and maxprocperuid. -Guido