Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Apr 2015 08:39:39 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Slawa Olhovchenkov <slw@zxy.spb.ru>
Cc:        arch@freebsd.org
Subject:   Re: default file descriptor limit ?
Message-ID:  <97929.1428914379@critter.freebsd.dk>
In-Reply-To: <20150413083159.GN1394@zxy.spb.ru>
References:  <78759.1428912996@critter.freebsd.dk> <79209.1428913320@critter.freebsd.dk> <20150413083159.GN1394@zxy.spb.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
--------
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.

>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...

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?97929.1428914379>