From owner-freebsd-arch@FreeBSD.ORG Mon Apr 13 08:52:35 2015 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3EA44CC3 for ; Mon, 13 Apr 2015 08:52:35 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8AAE839 for ; Mon, 13 Apr 2015 08:52:34 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1Yha6V-000JPA-CE; Mon, 13 Apr 2015 11:52:27 +0300 Date: Mon, 13 Apr 2015 11:52:27 +0300 From: Slawa Olhovchenkov To: Poul-Henning Kamp Subject: Re: default file descriptor limit ? Message-ID: <20150413085227.GO1394@zxy.spb.ru> References: <78759.1428912996@critter.freebsd.dk> <79209.1428913320@critter.freebsd.dk> <20150413083159.GN1394@zxy.spb.ru> <97929.1428914379@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <97929.1428914379@critter.freebsd.dk> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 08:52:35 -0000 On Mon, Apr 13, 2015 at 08:39:39AM +0000, Poul-Henning Kamp wrote: > -------- > In message <20150413083159.GN1394@zxy.spb.ru>, Slawa Olhovchenkov writes: > > >> >This wastes tons of pointless close system calls in programs which > >> >use the suboptimal but best practice: > >> > > >> > for (i = 3; i < sysconf(_SC_OPEN_MAX); i++) > >> > close(i); > >> > > >> >For reference Linux seems to default to 1024, leaving it up to > >> >massive server processes to increase the limit for themselves. > > > >This is typical only on startup, I think? > > No. This is mandatory whenever you spawn an sub process with less privilege. Hmm. 1. Whats [linux] application do this? 2. For case of reduce this limit -- how spawned application can increase this limit, if need? I am not sure, this is posible? > >May be now time to introduce new login class, for desktop users, [...] > > How about "now is the time to realize that very few processes need more > than a few tens of filedescriptors" ? > > If Linux can manage with a hardcoded default of 1024, so can we... And have many FAQs "how to overcome this restriction". Including "libc recompile"