🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #21594

Re: NNRPD resource consumption

#21594
From: Jan-Pieter Cornet
Date: Tue, 16 Sep 1997 00:00
67 lines
3687 bytes
In article <5v12u9$qhd$1@earth.execpc.com>,
Joe Greco <jgreco@ns.sol.net> wrote:
>In news.software.nntp article <5uq11i$j3e@shell.monmouth.com>, kwl@shell.monmouth.com (Ken Leland) wrote:
>:In article <5upqc7$6tf$1@jake.probe.net>,
>:Tim Russell <russell@probe.net> wrote:
>:>
>:>      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.
>:
>:Ouch, I can hear my overview disk screaming right now.
>
>What you could _try_ is using my overviews patch that does an MMAP
>of the .overview file (http://www.nntp.sol.net/patches/nov.mmap.patch)

I've also made patches that mmap the .overview files, available from
http://www.xs4all.nl/~johnpc/inn/ .

>This has the DOWNside of reading the entire .overview file when you
>execute a GROUP command.  However, once read, the file is mmap'd and
>a list of pointers is generated, so that further accesses are fast.

My patches, instead, simple mmap the file and then perform a binary search
on the overview file to search the correct record. This has the advantage
of not having to scan through the entire file (and because the search
is skewed, usually only reads a small percentage). Lookups in increasing
order, as XOVER usually does, are especially fast.

>In particular, this technique does NOT suffer horribly like the normal
>NOV implementation, if you should choose to do something strange like
>scan backwards through your NOV data.

My patches would do a binary search every time, although it only needs
a very few iterations, as the position of the last match is used as the
first search.

>In general, things seem better here with this patch.

Likewise. We had a newsserver that was completely disk-hogged on the
overview disk, and after this patch, the overview disk hardly had
anything to do anymore.

>Oh - one side note.  The apparent size of your nnrpd processes will
>grow, due to the mmap'ing.  That should not be a real problem though.

It depends on lot on how good the mmap implementation in your OS is.

Another side note: I jumped in to this discussion halfway through, so
I might miss something radical (like my patches are for 1.5.1, not (yet)
for 1.6x). Also, I didn't compare my patches to any patches mentioned here,
but I would be very interested in the results if anyone would :)

Cheers,

--
#! ##### Jan-Pieter Cornet ##### <johnpc@xs4all.net> ##### perl
++$_;$!=$_+++$_;($:,$,,$/,$*)=$!=~/.(.)...(.)(.).(.)/;$!=$_+$_;
($@,$\,$~)=$!=~/(.)(.).(.)/; $_="$,$/$:"; $@++; $~="$~$_";($_)=
\$$=~/\((.)/;$|=++$_;$_++;$|++;$~="$~ $@$:";`$~$/$\$*$, $|>&$_`

Technical Details
Message-ID: <5vmdsa$4pt$1@news0.xs4all.nl>
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> <5upqc7$6tf$1@jake.probe.net> <5uq11i$j3e@shell.monmouth.com> <5v12u9$qhd$1@earth.execpc.com>

Show Full Headers
Complete Article Headers
Message-ID: <5vmdsa$4pt$1@news0.xs4all.nl>
Subject: Re: NNRPD resource consumption
Date: Tue, 16 Sep 1997 00:00:00 +0000
From: johnpc@xs4all.nl (Jan-Pieter Cornet)
References: <5unqlf$jfa@shell.monmouth.com> <5upqc7$6tf$1@jake.probe.net> <5uq11i$j3e@shell.monmouth.com> <5v12u9$qhd$1@earth.execpc.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: 273004662
Distribution: inet
X-XS4ALL-Date: Tue, 16 Sep 1997 18:58:50 MET DST
Organization: XS4ALL Internet B.V.
Newsgroups: news.software.nntp