🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #63952

Re: NEWNEWS command

#63952
From: Curt Welch
Date: Fri, 07 Feb 2003 20:25
85 lines
5847 bytes
Russ Allbery <rra@stanford.edu> wrote:
> Curt Welch <curt@kcwc.com> writes:

> I don't believe that NEWNEWS is inherently any more expensive than
> requesting the same number of articles by article number apart from the
> binary search to find the starting date, which I really doubt is a
> substantial portion of the overall server load, particularly two orders
> of magnitude.

The binary search is mostly minor.

> The expensive operation from the INN standpoint is really
> locating and opening the overview database for all of those groups, which
> it would have to do anyway.

There are two ways you can try to do NEWNEWS.  The correct way requies you
to keep one list of all articles (inn history file), in which case a
NEWNEWS for very long time period with a very small set of groups causes
the server to "grep" a huge file just to return a few lines of data.
Hitting 1000 to 1 in bytes scanned to bytes returned is trivial.  An
example of how a client could abuse this implementation (wihtout realizing
their abuse) is simply to do 100 NEWNEWS commands, one for each group, all
with a date which was 1 month in the past.

The other way to implement it is by newsgroup so you get a separate article
list per newsgroup with timestamps.  This is broken because it will cause
NEWNEWS to return dups for cross posted articles (unless the server does
something special to eliminate the dups).  The way that gets abused is to
do a NEWNEWS command for a large set of groups (say *) with a very short
time period (say 1 minute).  A client trying to get a "full-feed" list of
message-ids for example could just hang in a loop doing DATE and NEWNEWS
commands.  Each NEWNEWS would force the server to check the database of
every group even though only a few hundred would actaully have new articles
in them.  Once again, the amount of data scaned vs the amount of data
returned can easily be 1000 to 1.

These are the worse case issues, and for more nomral use, where you are
checking for all new news say every few hours in a "normal sized" set of
groups, the waste would not be expected to be so bad because you would be
returning data for most groups which were checked.  But you are still
talking 10 to one ratios of data scanned to data returned.

> I also don't think that 500 groups is necessarily an appropriate
> threshold to tell people to get a real news feed.  I have, at various
> times, read at least that many groups with a normal news reader.

The issue isn't that "sucking" 500 groups is bad.  Doing it by NEWNEWS is
bad.  To figure out which articles are "new" only requies that the client
fetch the high water mark for each group.  All servers are well optimized
to return this information - many without wasting _any_ disk io because the
high water mark is such an important number it's in-memory for almost every
server.

> Now, if it were several thousand (as it is with the original pattern),
> that may be another question.  Although bear in mind that most of those
> groups are probably completely empty and therefore very fast to process.

But even faster if the client would simply have done a LIST ACTIVE *i*e*i*.
What server do you suspect can do NEWNEWS as easy as LIST ACTIVE? (newnews
of course supports a group "sys" entry, whereas LIST ACTIVE only supports
wildmats (oh, but you already told me people were adding group lists there
didn't you?), so that's a minor point).

Most clients that use NEWNEWS seldom care about the Message-Id so that's
not even important.  They simply want to fetch all the new news.  The
highwater mark for each group tells the client everything it needs to fetch
the articles.

NEWNEWS can be implemented in ways that make it "not so bad" most the time.
But it requires that the server keep a completly different database to time
stamp the arrivial of every article.  NEWNWES is the only command that
requies the server to do this.  So not only does it have efficiency issues
on it's own, it effects the effecenty of the entire server by forcing it to
keep more information about every article.

You can build servers to support NEWNEWS and they don't even have all that
much problem doing it.  For a fast server with a small load, it's not even
an issue. But when you are already using server farms to support thousands
of users, adding support for NEWNEWS, could get expensive if a lot of users
started using it.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Technical Details
Message-ID: <20030207152524.184$ts@newsreader.com>
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!archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
References: <veu0a.1907$cu1.373699@newsfep2-win.server.ntli.net> <20030206194838.136$Ah@newsreader.com> <b1v6ra$uph$2@puck.litech.org> <1iizzwuycuzdk.dlg@meowing.net> <b206n0$ld6$1@puck.litech.org> <20030207113921.151$EX@newsreader.com> <ylel6k2af0.fsf@windlord.stanford.edu>

Show Full Headers
Complete Article Headers
Message-ID: <20030207152524.184$ts@newsreader.com>
Subject: Re: NEWNEWS command
Date: Fri, 07 Feb 2003 20:25:24 +0000
From: curt@kcwc.com (Curt Welch)
References: <veu0a.1907$cu1.373699@newsfep2-win.server.ntli.net> <20030206194838.136$Ah@newsreader.com> <b1v6ra$uph$2@puck.litech.org> <1iizzwuycuzdk.dlg@meowing.net> <b206n0$ld6$1@puck.litech.org> <20030207113921.151$EX@newsreader.com> <ylel6k2af0.fsf@windlord.stanford.edu>
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!archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.nntp
X-Trace: NewsReader.Com UQeGeLI=mrkWfpO+jGuQiouDGfnL8xX0IX+Cm.TXF=PoROHf
X-Face: "p}G*1KH{+F7EYGKLb>ogDguabZ+%,?^epeFB!nzu`)`$=QcvL1KF6<0GH!Tbc!Sqo[|tV5
  %IW48mQf3K=Ci&gZ7]]aazx@]Y-nq!r5{yH/#,?@lDdUDvOfByB2hVW0.@OM%{l/{cT'{w
X-Url: http://CurtWelch.Com/
User-Agent: NewsReader.Com
Lines: 84