🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #15262

Re: NEWNEWS Command

#15262
From: Per Hedeland
Date: Sun, 23 Feb 1997 00:00
42 lines
2645 bytes
In article <5ecv0q$1bcm@usenet1y.prodigy.net> davidsen@tmr.com (bill
davidsen) writes:
>I always wondered why this command is so _slow_? My history file is
>about 2.5M lines, so the binary search used in INN would take ~22
>disk accesses to find the starting point. Now, if the NEWNEWS output
>is huge, and being sent over a slow link like a modem, it could take
>a long time to send. But the actual case is that the search is the
>time consuming part, with a huge delay before the article list
>starts to flow.

Well, I did a trace on an nnrpd running NEWNEWS, and the binary search
was indeed very fast - ~ 1 second and 15 reads to find the starting
point in a 170 MB history file. The time-consuming part was scanning all
the subsequent lines for matches, and the nnrpd seemed mostly CPU-bound
during this time. The delay in the start of the article list is probably
due to stdio buffering.

Thus the time used depends mostly on how long has passed since the time
given in the NEWNEWS command - my history seems to have some 100 bytes
per entry, i.e. if you receive 200k articles/day a NEWNEWS-user
connecting once/day would have to search through some 20 MB of data.
Things get worse if they specify a distribution pattern of course (I
didn't in the above test), as nnrpd will then have to open each
newsgroup-matching article, extract the distribution from it, and (if
any) check if it matches.

The case of the newsgroup-pattern being '*' is specifically recognized
as obviating the need to do newsgroup matching, so using it should be
faster (and in general a single NEWNEWS with a complex pattern should be
much better than multiple ones with simple patterns), but I couldn't
verify this as another "optimization":

    /* Optimization in case client asks for !* (no groups) */

new in INN 1.5, makes nnrpd core dump if you ask for '*'.:-) (I would
think the case this new optimization caters to is utterly rare...:-)

--Per Hedeland
per@erix.ericsson.se

Technical Details
Message-ID: <5epfof$ouc$1@news.du.etx.ericsson.se>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <5doh1j$en4$1@jair.pressenter.com> <E5GFKo.Goz@spcuna.spc.edu> <5ecv0q$1bcm@usenet1y.prodigy.net>

Show Full Headers
Complete Article Headers
Message-ID: <5epfof$ouc$1@news.du.etx.ericsson.se>
Subject: Re: NEWNEWS Command
Date: Sun, 23 Feb 1997 00:00:00 +0000
From: per@erix.ericsson.se (Per Hedeland)
References: <5doh1j$en4$1@jair.pressenter.com> <E5GFKo.Goz@spcuna.spc.edu> <5ecv0q$1bcm@usenet1y.prodigy.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.mbox.zip!not-for-mail
X-Deja-AN: 220843029
Organization: Ericsson Telecom, Stockholm, Sweden
NNTP-Posting-User: per
Newsgroups: news.software.nntp