🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #90470

Re: INN 2.7.1 death spiral under high load?

#90470
From: Julien ÉLIE
Date: Mon, 03 Jul 2023 11:03
96 lines
5344 bytes
Hi Russ,

>> Having googled a bit, there does not seem to be a more elegant way to
>> achieve that, unless switching to another method to read sockets
>> (poll(), libevent or).
> 
> Switching to libevent is almost certainly the right long-term solution
> (I've been thinking about this for ages and previously converted remctld
> to it), since then it handles all the many confusing variations of
> select/poll/epoll/etc. for you and you don't have to worry about figuring
> out which system has which variation.  It provides an equivalent of innd's
> current select loop that's much cleaner but works in a very similar way.
> But unfortunately it's a whole lot of quite disruptive work.
> 
> It would probably produce a noticable performance increase for really busy
> servers, too.  select is notoriously inefficient.

Yes, I totally agree for the long-term solution to switch to libevent.

For the time being, I've tried to integrate Diablo's hack into INN.  It 
seems to work (at least innd sees the wanted FD_SETSIZE size).

In INSTALL and in the documentation of rlimitnofile in inn.conf, I just 
plan to add:

   If you really need using more than 1024 file descriptors, you can try
   to rebuild INN with for instance the "-DLARGE_FD_SETSIZE=4096" option
   given to the compiler to increase the possible value to 4096.


Incidentally, is the "File Descriptor Limits" still accurate in INSTALL?

   INN won't be able to increase the limits above the hard limits set by
   your operating system; on some systems, that hard limit is normally
   256 file descriptors (Linux, for example).  On others, like Solaris,
   it's 1024.  Increasing the limit beyond that value may require serious
   system configuration work.  (On some operating systems, it requires
   patching and recompiling the kernel.  On Solaris it can be changed in
   /etc/system, but for 2.6 or earlier the limit cannot be increased
   beyond 1024 without breaking select(2) and thereby breaking all of
   INN.  For current versions of Linux, you may be able to change the
   maximum by writing to /proc/sys/fs/file-max.)

Isn't the hard limit 1024 (or more?) for Linux, and 256 for Solaris?




I've found out that when systemd is in use, systemd/sd-daemon.h includes 
asm/socket.h when __USE_MISC is set, which in turn includes 
linux/posix_types.h which unconditionnaly redefines __FD_SETSIZE to 1024 
(even if it has another value) for use with __kernel_fd_set.
So __FD_SETSIZE has to be forced before any inclusion of bits/types.h 
and after any inclusion of systemd/sd-daemon.h on Linux 
(systemd/sd-daemon.h also includes bits/types.h).

I am unsure of the consequences but systemd might not work with INN if a 
systemd file descriptor exceeds 1024 (?)  (though the fd_set size used 
with select(2) has the wanted LARGE_FD_SETSIZE value, from sys/select.h)
In doubt, I could prevent LARGE_FD_SETSIZE from being used when systemd 
is also used?



Jesse, I'll also change the log line:
     xxx:yyy zzz free but was in SMASK
to:
     xxx:yyy zzz free but was in SMASK; looks like fd_set is not large 
enough (you may want to increase FD_SETSIZE to a higher value by 
rebuilding INN with -DLARGE_FD_SETSIZE=4096)


This way, I hope it will be of help for other people coming across that 
issue.



Also, the documentation of the rlimitnofile parameter should say that 
innd may malfunction, and not only "suffer reduced functionality" :)

  The maximum number of file descriptors that innd(8) or innfeed(8) can have
  open at once.  If innd(8) or innfeed(8) attempts to open more file
  descriptors than this value, it is possible the program may throttle or
-otherwise suffer reduced functionality.  The number of open file
+otherwise malfunction or suffer reduced functionality.



I hope all of these changes will be useful, and you're happy with your 
new hardware setup Jesse!

-- 
Julien ÉLIE

« – Quel a été votre plus beau jour ?
   – Une nuit. » (Brigitte Bardot)
Technical Details
Message-ID: <u7u9tc$2ls19$1@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
References: <u7l7kl$1qqb$1@nnrp.usenet.blueworldhosting.com> <u7mpcq$16ug$1@nnrp.usenet.blueworldhosting.com> <u7mtup$2h67a$1@news.trigofacile.com> <u7ogvd$2ifbq$1@news.trigofacile.com> <u7oljn$1chb$1@nnrp.usenet.blueworldhosting.com> <u7ollu$1jmj$1@nnrp.usenet.blueworldhosting.com> <u7phln$2is6p$1@news.trigofacile.com> <871qhrd13m.fsf@hope.eyrie.org>

Show Full Headers
Complete Article Headers
Message-ID: <u7u9tc$2ls19$1@news.trigofacile.com>
Subject: Re: INN 2.7.1 death spiral under high load?
Date: Mon, 3 Jul 2023 13:03:08 +0200
From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
References: <u7l7kl$1qqb$1@nnrp.usenet.blueworldhosting.com> <u7mpcq$16ug$1@nnrp.usenet.blueworldhosting.com> <u7mtup$2h67a$1@news.trigofacile.com> <u7ogvd$2ifbq$1@news.trigofacile.com> <u7oljn$1chb$1@nnrp.usenet.blueworldhosting.com> <u7ollu$1jmj$1@nnrp.usenet.blueworldhosting.com> <u7phln$2is6p$1@news.trigofacile.com> <871qhrd13m.fsf@hope.eyrie.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
Newsgroups: news.software.nntp
Organization: Groupes francophones par TrigoFACILE
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 3 Jul 2023 11:03:08 -0000 (UTC)
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
 Gecko/20100101 Thunderbird/102.12.0
Cancel-Lock: sha1:u2BmRIClUwoahOTExvOnamh3yKQ= sha256:Z/hNEs3eSqS5wFINReUK8df08RwGSTqtPzRpHCA4EZo=
In-Reply-To: <871qhrd13m.fsf@hope.eyrie.org>