🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #37225

Re: Abandoning uniover - but how?

#37225
From: Curt Welch
Date: Tue, 04 May 1999 00:00
102 lines
6516 bytes
cmsedore@my-dejanews.com wrote:

> Allow me to offer what I did in tortoise.  I wrote the overview entries
> (sans number) for each article ahead of the article in the article store.
> This meant that I could grab them anytime I wanted for any group to which
> it was posted by just looking it up.

So you just add the overview record as a new line in the front of the
article?  Does that really buy you anything?  Sounds to me like it just
mostly wastes disk space.  If you have to read the block to get that
overview data it's not going to be much (any?) faster than just reading
the entire header and rebuilding the overview record.  The much longer
delay there is the read -- not the parsing and constructing the overview
data.  Depending on how your article store works, you might have to read
a few more blocks to get the entire header, but in most cases, I'd expect
the entire header to fall into one block anyway.

> In addition, I wrote an overview caching mechanism, which operates in one
> of two ways.  The more traditional way is that it prebuilds data for each
> group as it receives articles.  It writes the cached data (the entire
> overview range) into a cyclical store, in blocks which are sized on 16k
> intervals. New articles are appended until the whole allocated space is
> full, then the whole block is rewritten to the current position in the
> store.

So you have one 16K block active in memory for each group?  16K x 30,000
groups is 480 Meg of memory - not a very small memory foot print eh?  Do
you always keep all those in memory or do you limit the memory usage
somehow - like by writing out cache block that haven't been accessed
recently?

It also can be set to rewrite the whole block periodically.  In
> most cases, the overview cache store is rewritten by reading in the
> current cache block, keeping the useful entries and tossing the rest
> (rather than seeking all over creation to get the entries from the
> article stores).  Updates happen in-place unless the current pointer is
> near, in which case they're appended to the current position in the
> store. Overview entries are always available from the article store, so
> even if they're not in the cache, they'll be pulled off disk so there's
> no gap.
>
> The other way that it can operate is to only cache overview information
> for groups which are read.  After the first xover, the overview cache is
> maintained until it expires (by being overwritten in the cyclical store).
> This methodology is extremely fast and resource efficient if you have
> somewhat consistent group readership patterns.
>
> > 4 - expire has got to be replaced by some process which can be run
> > continuously. This applies to history and overview, and will allow more
> > scaling of news. Fortunately, this isn't causing major user visible
> > problems now, but it does suggest that if a history solution could be
> > bundled with an expire solution life might be better for news admins.
>
> Overview expiration in the above scheme is automatic.

Yeah, that's sounds basically like what I'm (working on) doing - storing
the overview in a cyclic store -- in my case the article stores.

> I've gone to a
> cyclical history storage methodology, so I don't worry much about that.

My history file is a simple hashed file but each block acts as a cyclic
store.  The system is designed so the server "knows" what articles have
expired and what hasn't without having to do much work, so it's easy to
"expire" old entries from the history block as new entires are added.

So there's no external batch expire process either.  The history
file expands automatically as needed but once it's reached the required
size, each block is updated as new entries are added.

> > 5 - It is highly desirable to have overview able to accept articles in
> > an arbitrary order. This facilitates both xrefslave feeds and any
> > future multi threaded incoming feed scheme, in that as long as article
> > numbers are unique there is not a significant performance penalty.
>
> My scheme doesn't do so well with this.  If the cache code is asked to
> append something that's not the next article in the sequence, it
> overwrites the whole block to keep things consistent.  Sub-optimal, but
> functional.

I don't support any type of slaving mode currently but the server could
(I guess) deal with it - but i'm not yet caching xover data which is were
the more complex problems show up.  But to me, if articles show up out of
sequence when parsing Xref lines, you have a real problem anyway.
Newsreaders will get confused if they see those gaps - and the server can't
really hide the gaps unless it "knows" for sure the the source of the
articles will never leave a gap ... which means you can't deliver articles
in multiple parallel streams - which is hard to live without....

So, my current thought is to try and avoid the whole xref slave issue by
desiging the server in such a way that you won't ever need to run a farm of
slaved servers to support a large user base.  I basically split the server
up into multiple processes which can be distributed over a large number of
machines to support a very large user base (in theory).  But my current
implementation doesn't yet support a lot of the intended distributed
design so it's hard to say how well it will really work at this point.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/

Technical Details
Message-ID: <19990504143226.915$cc@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!not-for-mail
References: <7f5p31$vmq$1@news.netmar.com> <7g5b88$pi$1@twwells.com> <19990428114141.388$tD@newsreader.com> <7g87un$eob$1@twwells.com> <7gl2qc$4s1i$1@newssvr03-int.news.prodigy.com> <7glht1$2ag$1@nnrp1.dejanews.com>

Show Full Headers
Complete Article Headers
Message-ID: <19990504143226.915$cc@newsreader.com>
Subject: Re: Abandoning uniover - but how?
Date: Tue, 04 May 1999 00:00:00 +0000
From: curt@kcwc.com (Curt Welch)
References: <7f5p31$vmq$1@news.netmar.com> <7g5b88$pi$1@twwells.com> <19990428114141.388$tD@newsreader.com> <7g87un$eob$1@twwells.com> <7gl2qc$4s1i$1@newssvr03-int.news.prodigy.com> <7glht1$2ag$1@nnrp1.dejanews.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!not-for-mail
X-Deja-AN: 474009001
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-User: Curt@NewsReader.Com
Organization: NewsReader.Com
X-Url: http://CurtWelch.Com/
Newsgroups: news.software.nntp