From owner-freebsd-current Wed Dec 10 00:02:09 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id AAA26701 for current-outgoing; Wed, 10 Dec 1997 00:02:09 -0800 (PST) (envelope-from owner-freebsd-current) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id AAA26696 for ; Wed, 10 Dec 1997 00:01:59 -0800 (PST) (envelope-from bde@zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.6.9) id SAA13693; Wed, 10 Dec 1997 18:58:34 +1100 Date: Wed, 10 Dec 1997 18:58:34 +1100 From: Bruce Evans Message-Id: <199712100758.SAA13693@godzilla.zeta.org.au> To: freebsd-current@FreeBSD.ORG, j@uriah.heep.sax.de Subject: Re: Where can I get help ? Cc: ircadmin@shellnet.co.uk Sender: owner-freebsd-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >My current limits look like: > >j@uriah 439% limit -h descriptors >descriptors 680 Using a real shell: $ limit -h descriptors limit: not found $ ulimit $ ulimit -Hn 360 >(That's the `hard' limit.) > >This number is NPROC*2, with NPROC being computed in /sys/conf/param.c >as 20 + 16 * MAXUSERS. So basically, by bumping `maxusers' (in your >kernel config file) to (1024 / 2 - 20) / 16 (= 30.75 :-), you'd get a >default of 1024. > >Actually, you can change it at runtime using sysctl, it's the sysctl >variable kern.maxfilesperproc (you probably want kern.maxfiles to be >larger then). Thus, no kernel recompilation needed. (Disclaimer: i Have you tried it? :-) It only works for login classes that set the hard limit (in the current login.conf, these are root (value infinity), daemon (1024), news (256) and dialer (32)). Everything else inherits the old hard limits from init. This is just one of the reasons why kern.maxfilesperproc should not exist. It only works to restrict (break) the limits advertised by getrlimit(). It just gets in the way of expanding the limits. >don't know offhand when this tunable variable has been introduced, so >it depends on your FreeBSD version.) kern.maxfiles was introduced in FreeBSD-2.0 (actually in 4.4BSD-Lite). kern.maxfilesperproc was introduced in FreeBSD-2.0.5 (kern_descrip.c rev.1.8 1995/02/20). It was broken (read-only) in -current between rev.1.19 (1995/12/04) and rev.1.32 (1996/09/28). It should have been removed when login classes were introduced. Login classes make it possible for increasing it to work (all classes just need to set a hard limit to pick up the new limit), but they also make it redundant. Bruce