🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #83876

Re: File descriptor limits.

#83876
From: River Tarnell
Date: Thu, 17 Feb 2011 23:52
22 lines
2274 bytes
In article <ijkbb3$612$1@snarked.org>,
D. Stussy <replies@newsgroups.kd6lvw.ampr.org> wrote:
> I also complained at kernel.org by requesting an "enhancement" type-bug - #
> 29342, and suggested that the limit be based on the actual resource
> available ("ulimit -n") as opposed to hard-coded in a define.

As far as I know, this is impossible.  select() uses the C type 
'fd_set', which has to be defined at compile time to hold a particular 
number of fds.  (It can't be allocated dynamically because there's no 
API for that.)  FD_SETSIZE sets the number of fds in an fd_set.

The real fix here is for INN on Linux to start using epoll, which is a 
new, much more efficient select()-like interface (equivalent to kqueue 
on BSD, event ports on Solaris, etc).  As well as being much faster for 
non-trivial fd sets, epoll has no limit on number of fds which can be 
monitored.

An interim fix would be to use poll() instead of select().  Although it 
offers very little (or no) performance advantage, it does remove the 
compile-time fd limit.

	- river.
Technical Details
Message-ID: <ijkcb8$1im$1@tamara.tcx.org.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!goblin3!goblin.stu.neva.ru!news.tcx.org.uk!.POSTED!news.tcx.org.uk!not-for-mail
References: <ijc6vh$12l$1@snarked.org> <87lj1g4a0y.fsf@araminta.anjou.terraraq.org.uk> <4d5d37ad$0$41113$e4fe514c@news.xs4all.nl> <ijkbb3$612$1@snarked.org>

Show Full Headers
Complete Article Headers
Message-ID: <ijkcb8$1im$1@tamara.tcx.org.uk>
Subject: Re: File descriptor limits.
Date: Thu, 17 Feb 2011 23:52:08 +0000
From: River Tarnell <r.tarnell@IEEE.ORG>
References: <ijc6vh$12l$1@snarked.org> <87lj1g4a0y.fsf@araminta.anjou.terraraq.org.uk> <4d5d37ad$0$41113$e4fe514c@news.xs4all.nl> <ijkbb3$612$1@snarked.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!goblin3!goblin.stu.neva.ru!news.tcx.org.uk!.POSTED!news.tcx.org.uk!not-for-mail
Newsgroups: news.software.nntp
Organization: TCX.ORG.UK
Lines: 22
Sender: localhost@tamara.tcx.org.uk
NNTP-Posting-Host: /jwEct2pZt+ylrTs3YiU6w.user.tamara.tcx.org.uk
X-Complaints-To: usenet@TCX.ORG.UK
NNTP-Posting-Date: Thu, 17 Feb 2011 23:52:08 +0000 (UTC)
X-Notice: Filtered by postfilter v. 0.8.1
X-Newsreader: trn 4.0-test76 (Apr 2, 2001)
Cancel-Lock: sha1:sbGnmwNq860tW+hQUH5rW1CIRbg=
X-Original-Bytes: 2056