Article View: news.software.nntp
Article #90473Re: INN 2.7.1 death spiral under high load?
From: Julien ÉLIE
Date: Mon, 03 Jul 2023 16:46
Date: Mon, 03 Jul 2023 16:46
87 lines
4259 bytes
4259 bytes
Hi Russ,
>> Isn't the hard limit 1024 (or more?) for Linux, and 256 for Solaris?
>
> 1024 is now the default for Linux, it looks like, and you can now change
> it dynamically using the normal ulimit command (no need for messing around
> in proc). I have no idea what Solaris does these days. I suspect I last
> tested that part of INN against Solaris 7, which is a very long time ago.
Solaris 10 and 11 have in sys/select.h:
#ifndef FD_SETSIZE
#ifdef _LP64
#define FD_SETSIZE 65536
#else
#define FD_SETSIZE 1024
#endif /* _LP64 */
so on Solaris 64-bit, the default is large enough :)
I bet we can now remove the documentation of the 256 limit for Solaris
as it no longer applies to current versions.
>> I am unsure of the consequences but systemd might not work with INN if a
>> systemd file descriptor exceeds 1024 (?)
>
> I suspect it will only matter if the notification file descriptor is over
> 1024, which shouldn't happen because it gets passed in on startup.
Yep you're right.
>> 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)
>
> We should be able to do better than this and detect the actual problem
> before we corrupt our data structures, I think, by testing whether a file
> descriptor is larger than FD_SETSIZE.
Sure.
The check could be done in RCHANadd, SCHANadd, and WCHANadd.
It is when channels.max_fd and channels.max_sleep_fd are updated, when
needed.
We could then log a warn message each time these max_fd or max_sleep_fd
counts *would* have been updated and be higher than FD_SETSIZE-1? And
immediately close the channel?
This way, the select(channels.max_fd + 1, &rdfds, &wrfds, NULL, &tv)
call won't go beyond the expected limit.
But no new connection will be seen (they will probably timeout).
I see that innfeed already does something like that in endpoint.c:
#if defined(FD_SETSIZE)
if ((unsigned int) fd >= FD_SETSIZE) {
warn("ME fd (%d) looks too big (%d -- FD_SETSIZE)", fd,
FD_SETSIZE);
return NULL;
}
#else
if (fd > (sizeof(fd_set) * CHAR_BIT)) {
warn("ME fd (%d) looks too big (%d -- sizeof (fd_set) *
CHAR_BIT)",
fd, (sizeof(fd_set) * CHAR_BIT));
return NULL;
}
#endif
Would a similar check be added for the xCHANadd functions?
I guess the check could be done by a new function in lib/fdlimit.c that
can be used for both innd and innfeed, returning true/false.
--
Julien ÉLIE
« Traversez la rivière en foule, le crocodile ne vous mangera pas. »
(proverbe malgache)
Technical Details
Message-ID:
<u7uu1r$2nolf$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-mailReferences:
<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> <u7u9tc$2ls19$1@news.trigofacile.com> <87fs65ouay.fsf@hope.eyrie.org>Show Full Headers
Complete Article Headers
Message-ID: <u7uu1r$2nolf$1@news.trigofacile.com> Subject: Re: INN 2.7.1 death spiral under high load? Date: Mon, 3 Jul 2023 18:46:51 +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> <u7u9tc$2ls19$1@news.trigofacile.com> <87fs65ouay.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 16:46:51 -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:tN1R1+ePAsYvFAnsR+HklaKt3z0= sha256:4OXhL5jUwSg5HGSedDtYOUUmkqJMkGuqaeNEaq1pzJw= In-Reply-To: <87fs65ouay.fsf@hope.eyrie.org>