🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #84116

Re: File descriptor limits.

#84116
From: Julien ÉLIE
Date: Sat, 11 Jun 2011 09:23
49 lines
2657 bytes
Hi Dieter,

> I'm having a problem with the number of file descriptors.
> 
> I'm getting these errors in my logs - wtih 1024 descriptors:
> 
> innd: SERVER cant accept RCreader Too many open files
> innd: innfeed! cant socketpair Too many open files
> innd: innfeed! cant restart Too many open files
> innd: tradindexed: cannot open /news/overview/...IDX: Too many open files
> 
> ....And when I increase the number ("ulimit -n") to above 1,024, I get:
> 
> innfeed[5925]: ME fd (1026) looks too big (1024 -- FD_SETSIZE)
>    (and the connection is rejected)

Pretty interestingly, I read the following code in innfeed:

#if defined (FD_SETSIZE)
      if ((unsigned int) fd >= FD_SETSIZE)
        {
          sizelogged = true ;
          warn ("ME fd (%d) looks too big (%d -- FD_SETSIZE)", fd,
                FD_SETSIZE) ;
          return NULL ;
        }
#else
      if (fd > (sizeof (fd_set) * CHAR_BIT))
        {
          sizelogged = true ;
          warn ("ME fd (%d) looks too big (%d -- sizeof (fd_set) * CHAR_BIT)",
                fd, (sizeof (fd_set) * CHAR_BIT)) ;
          return NULL ;
        }
#endif



A useful protection!
I wonder if it should not be implemented at other places where fd_set is used.

Several people in this newsgroup and in inn-workers suggest a switch to
epoll() instead of select().  Is epoll() as portable as select()?

-- 
Julien ÉLIE

« Un voyage de mille lieues commence toujours par un premier pas. »
  (Lao Zi)
Technical Details
Message-ID: <95gqhdFd2hU1@mid.individual.net>
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.ams3.giganews.com!border1.nntp.ams2.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
References: <ijc6vh$12l$1@snarked.org>

Show Full Headers
Complete Article Headers
Message-ID: <95gqhdFd2hU1@mid.individual.net>
Subject: Re: File descriptor limits.
Date: Sat, 11 Jun 2011 11:23:56 +0200
From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
References: <ijc6vh$12l$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.ams3.giganews.com!border1.nntp.ams2.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
Newsgroups: news.software.nntp
Organization: TrigoFACILE -- http://www.trigofacile.com/
Lines: 49
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: individual.net tCmv+os2Y3BjRQB3RQjfDASYw7thMgv81XTLMeLYrE8k1eLSw=
Cancel-Lock: sha1:G+qvC8RpZLra/Xvz6y8jYaiA+jk=
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; fr;
In-Reply-To: <ijc6vh$12l$1@snarked.org>
X-Original-Bytes: 2510