Article View: news.software.nntp
Article #14837Re: Redesign spool and history database
From: Forrest J. Cavalier III
Date: Fri, 07 Feb 1997 00:00
Date: Fri, 07 Feb 1997 00:00
95 lines
4795 bytes
4795 bytes
After I posted, I found a thread: "how to speed up innd" from
July 96 in Deja News. Searching for Message-Id:
<4sfnpn$5c0$1@bushwire.mira.net.au>
should find the thread if you are interested.
In that thread, Mark Delany (mardk@mira.net.au) discusses
the problems with integrating a "News-Storage API" onto
inn. He said that it required "significant surgery," but he felt
that future generations of news programs could benefit if
someone would separate INN from its marriage to UFS via
an API.
Has anyone done work on this? Or even looked into it to
see what needs to be done? What is going into inn 1.6?
-------------------------------------------------------------
Brad wrote:
>Anyway, I hear this is coming, and my predictions are it should be an order
>of magnitude faster than INN and in fact I don't know if you could make
>something any faster, other than through clever work on how overviews are
>efficiently written -- and given directories so you can seek into them
>etc.
I am interested in something that would work with nnrpd newsreaders
also. (Local spool newsreaders need not apply.)
My idea is similar to the one described by Brad, where the
history file is used to keep the block and offset of each
article.
In my nutshell (kind of referencing Brad's nutshell, since some
may be familiar with it.)
Instead of N *really big* blocks of storage representing an
expire class, I'd use subdirectories. There would be
a top level of 64 top level subdirectories representing the
expire class. (More directories when usenet grows.)
Below that 256 subdirectories that actually contain the
articles. Each of those subdirectories would have about
256 entries. (For a 14 day feed this would hold 300K articles.)
The filename location of an article would be determined by hashing
the message ID, using that to look up the expiration class, and
using the hash value and expiration class to determine which directory.
No history file, instead the message hash code is an index into
an "expiration table" which uses 1 byte per index. (Even if a
16x factor is used to keep the hash table pretty empty, a 250K
article x 14 day expiration table is only 32Mbytes.)
And the same with Brad's scheme: no symlinking for cross posts.
Brad's scheme cancels an article by clearing the history entry, and
leaving it in the spool. Not a big waste of space, but I would remove
the entry from the expiration table and put a zero length article in
the spool.
Lookup by article number would have to be done from the overview,
but the lookup could be done on the machine that runs nnrpd, which
is better scaling when using NFS mounted spools. (And a sorted overview
could be binary searched, unlike the current directory search which
must be linear.)
I don't have an easy solution to the "extra credit" problems of
overview, but that isn't solved well in inn now, nor Brad's scheme.
I think there is a big win for caching, since almost all storing
and most reading is going to come out of one or two top level
subdirectories (the "current" ones), and the 256 directories below
them.
Splitting the spool across disks might be easier because the top
64 x 256 subdirectory names would be unchanging. (The fan-out
number is set by a hash code to directory path function which
could be changed to accomodate individual needs.) With Brad's
scheme, the big block file must be on the same device, right?
For example: If you had two devices, make it 128 top level
subdirectories instead of 64, with each expire class residing in two
directories, one on each device. The hash code method of
generating file path will automatically share the load.
I think NFS cacheing for reading would work better than Brad's scheme because
there is no big block file, and no long seeking.
Writes (servicing incoming feed) is probably slower, but I think about 300
reader clients is as much I/O load as an incoming feed right now.
Forrest Cavalier
Mib Software
Technical Details
Message-ID:
<5dfhdq$90b@news1.epix.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-mailReferences:
<5dd8dn$ml7@news1.epix.net> <5ddfma$aq0@fugue.clari.net>Show Full Headers
Complete Article Headers
Message-ID: <5dfhdq$90b@news1.epix.net> Subject: Re: Redesign spool and history database Date: Fri, 07 Feb 1997 00:00:00 +0000 From: mibsoft@epix.net (Forrest J. Cavalier III) References: <5dd8dn$ml7@news1.epix.net> <5ddfma$aq0@fugue.clari.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: 215087563 Content-type: Text/Plain; charset=US-ASCII Organization: Mib Software Mime-version: 1.0 Newsgroups: news.software.nntp