🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #21281

Re: NNRPD resource consumption

#21281
From: coneill
Date: Fri, 05 Sep 1997 00:00
63 lines
3770 bytes

russell@probe.net (Tim Russell) writes:
>     On looking through the NNRPD code recently to see just what the hell
> was going on, I noticed the following:
> 
>       1) Joe User is a news freak.  He checks like every 10 minutes for
>          new articles.
> 
>       2) Joe fires up an XOVER on a group that has, say, 37,000 articles
>          in it.  The XOVER request, however, is only for, say, the last
>          four articles, which are new to him.
> 
>       3) NNRPD satisfies this request by opening the .overview file, which
>          is, say, 8M in size, and proceeding to read through the entire
>          file until it gets to the record number it needs, then it spits
>          out records.
> 
>     So basically, every time someone enters a group with an 8M overview file,
> the effect is that of reading through said file locally on the system.
> Needless to say, get 30 or so of these going, and you have one seriously
> disk-bound system.
> 
>     If your expireover keeps blowing off, as mine does, due to lack of memory,
> since that program reads the entire damn .overview file it's working on into
> a memory database, so much the worse.  More stuff for the NNRPD's to read
> through.
> 
>     I think that work /really really/ needs to be done on making the .overview
> files an actual database rather than just a text file.  That's where the big
> huge performance hit is.
> 
>     It could help a lot to simply keep another file of 32-bit integers that
> point to the start of .overview lines.  That file could be accessed by
> lseek()ing to the appropriate integer for the line one wants, and using the
> number returned for an lseek() on the .overview file.

I'm hoping to integrate this into 1.6/1.7

Overview Indices
 - Adds a flat binaries index that as stored in the same directory as the
   overview text file, but in another file.  The index stores the article
   number along with the offset that the overview record starts at.
 - NNRPD reads the index into memory when overview is opened as uses the
   index to locate articles in the overview text file instead of linear
   searching.
 - We instrumented NNRPD to report the amount of overview data read from
   disk compared to what was actually sent to the client.  We were seeing
   about 50% more overview data read per day than article data, even though
   only sent about 10% of the overview data to the client.  With indices,
   the overhead to search overhead to reduced to about 10% as opposed to an
   order of magnitude.

I haven't seen anyone suggest structure for overview that's better than this.

Anyone have ideas on how to improve on the above?  I've thought about a CNFS
style mechanism, but I think we gain a lot currently by having the
records (at least logically) sequential.  I also think we need to
rewrite expireover so that it doesn't bother to sort the overview
entries anymore.  If we do that then we can eliminate the memory
footprint and cpu overhead of expireover.

Technical Details
Message-ID: <86iuwfv14m.fsf@blah.erols.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: <5unqlf$jfa@shell.monmouth.com> <5uo3j0$fah@dfw-ixnews1.ix.netcom.com> <5uphmp$86q$1@flea.best.net> <5upijp$2oi@shell.monmouth.com> <5upqc7$6tf$1@jake.probe.net>

Show Full Headers
Complete Article Headers
Message-ID: <86iuwfv14m.fsf@blah.erols.com>
Subject: Re: NNRPD resource consumption
Date: Fri, 05 Sep 1997 00:00:00 +0000
From: coneill@blah.erols.com
References: <5unqlf$jfa@shell.monmouth.com> <5uo3j0$fah@dfw-ixnews1.ix.netcom.com> <5uphmp$86q$1@flea.best.net> <5upijp$2oi@shell.monmouth.com> <5upqc7$6tf$1@jake.probe.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: 270121937
Distribution: inet
Organization: Erol's Internet Services
X-Received-On: 5 Sep 1997 22:36:52 GMT
Newsgroups: news.software.nntp