🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
9 messages
9 total messages Started by Forrest J. Cavalier III Thu, 06 Feb 1997 00:00
Redesign spool and history database
#14809
Author: Forrest J. Cavalier III
Date: Thu, 06 Feb 1997 00:00
24 lines
1260 bytes

Has anyone made any comments or done any work on redesigning
the spool side of INN?  What I have in mind is doing away
with DBZ lookup of message ID, and using the message ID
itself (transformed and chopped up into directory/path parts)

- This would even out the average directory length, and make
the history database (DBZ) unnecessary.  

- Symlinking is not necessary for crossposts.

- What I have in mind would also make expires run a lot faster.

------------------------------------------------------------------

I did a couple of Deja News searches, but didn't come up
with anything.  Has anyone done this?  Is anyone interested?

Forrest J Cavalier III
Mib Software


Re: Redesign spool and history database
#14795
Author: Brad Templeton
Date: Thu, 06 Feb 1997 00:00
77 lines
3913 bytes
Some time last year I designed a new underlying news system which is
much more efficient than this, and in which expire takes effectively
no time, other than a pass over the history file to find articles that
need to expire early and nop them out.

And I'm told that some brave soul is actually integrating it into INN, but
so far has only done a feed hub with it, no reading.

The design is close to perfect, in that it is hard to imagine how it could
be faster for taking a feed and expiring, though possibly one could
design some clever clustering algorithms for reading.

In a nutshell:

	You allocate N chunks of fixed sized disk blocks.  These can be
	in the FS, or raw disk partitions.  Turns out the FS isn't as
	bad as you think and has some advantages.   Each of the N chunks
	represents an "expire class", so you might put highly valuable
	articles in a large chunks, and alt.binaries in another pool.

	As articles come in, you simple write them out to their chunk
	using a circular pointer.  As new articles come in, the overwrite
	old articles.   Receiving and storing an article consists of
	calculating the expire class, then a seek and a write.  Done
	several at a time, it can be a seek and one big long block write
	that outputs 100 articles at a time.   You work at the raw speed
	of disk.

	You log to the history file and log file the block ID and seek address
	and length of the article, as well as supposed article number
	information.

	The slight hard part -- you also update, in batches for efficiency,
	overview files, adding a block ID and seek address to the overview
	information.

	Feeding tools take the seek address and length, and just seek and
	block read.  You can't get more efficient than that.

	Reading tools pretend to use the article number, but really just
	take the seek address and length from the overview or history,
	and seek and read.

	There *is* no expire.  Disk is fully utilized at all times, too,
	there is no "free list."   You might define a special expire class
	that has a real expire which compacts the block, but I am not
	sure why.

	You do need to run a simple expire which scans the history file,
	finds articles with explicit expire dates, and, if past them,
	nops out their entries in the overview files.   No space is
	saved but the ability to run your disk at full utilization with
	no thrashing should make up for this.  Cancel is just an overview
	nop.

	All articles have their ID stored at the front, so that when you read
	an article, you check for this ID to see if it's been overwritten
	(expired), and return null if it has been.


	Extra Credit: Write some simple routines to fetch articles by numbers
	for people who want to manually browse the spool.  Not hard, just
	open overview, find article number, get seek address and block,
	go there and output.


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.
-- 
Brad Templeton, publisher, ClariNet Communications Corp.	 info@clari.net
The net's #1 E-Newspaper (1,400,000 paid sbscrbrs.)  http://www.clari.net/brad/

Re: Redesign spool and history database
#14798
Author: Matt Dillon
Date: Thu, 06 Feb 1997 00:00
53 lines
2859 bytes
:In article <5dd8dn$ml7@news1.epix.net>,
:Forrest J. Cavalier III <mibsoft@epix.net> wrote:
:>
:>Has anyone made any comments or done any work on redesigning
:>the spool side of INN?  What I have in mind is doing away
:>with DBZ lookup of message ID, and using the message ID
:>itself (transformed and chopped up into directory/path parts)
:>
:>- This would even out the average directory length, and make
:>the history database (DBZ) unnecessary.  
:>
:>- Symlinking is not necessary for crossposts.
:>
:>- What I have in mind would also make expires run a lot faster.
:>
:>------------------------------------------------------------------
:>
:>I did a couple of Deja News searches, but didn't come up
:>with anything.  Has anyone done this?  Is anyone interested?
:>
:>Forrest J Cavalier III
:>Mib Software

    I just released software that does a lot of this.  It is not INN
    compatible, and supports only feed machines (not newsreader machines):

    http://www.backplane.com/

    I call the system 'Diablo'.  It stores articles by time received, 
    creating a new directory every 10 minutes.  There is still a history
    file, because hash table lookups in the history file are much, much
    faster then filesystem namei() calls, even when you are directly
    referencing the article. I store the expiration in the history file
    and update it in-place when expire is run, and expire runs a lot
    more efficiently due to the fewer number of directories and 
    essentially linear-cacheable-access to them due to the time-ordering
    of the history file.  I still store articles as individual files, though.
    Even so, Diablo can accept 40 articles/sec in-aggregate, about 10 times 
    faster then INN on the newsfeeds machine I switched over.

    I've also read Brad Templeton's comments in his followup to your 
    post.  Using fixed-partition chunking is potentially even faster,
    though I think realistically it would be better to use 
    multiple-articles-in-one-file-by-expiration, which he also mentioned.
    This would solve the expire problem completely.  I don't do this in
    Diablo, but only because it complicates the software too much for a first
    release.  It makes a lot of sense, though.

						-Matt


Re: Redesign spool and history database
#14829
Author: Forrest J. Cavalier III
Date: Fri, 07 Feb 1997 00:00
29 lines
1606 bytes
In article <5dd8dn$ml7@news1.epix.net>, mibsoft@epix.net wrote...
>I did a couple of Deja News searches, but didn't come up
>with anything.  Has anyone done this?  Is anyone interested?

See, I was using the wrong keywords.  Someone in e-mail pointed
out that I should have used the keywords "Scott Fritchie"  :-)

Thread from 4/17/1996 (or there abouts) described a feeder only
solution which stored articles under directories and files based
on MD5 hash of the message ID.

To summarize, I think my idea has one significant
improvement: use an expiration table to map hash values
to an expiration code, and then use the expiration code as
the top-level directory.  

Result: articles with the same expiration code are grouped into
the same directories.

Maybe someone can post some more info about his scheme, and if
it got propagated elsewhere, and especially if nnrp readers
were ever supported. (I'll repost what I learn through e-mail.)

Forrest Cavalier
Mib Software


Re: Redesign spool and history database
#14837
Author: Forrest J. Cavalier III
Date: Fri, 07 Feb 1997 00:00
95 lines
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


Re: Redesign spool and history database
#14839
Author: Forrest J. Cavalier III
Date: Fri, 07 Feb 1997 00:00
41 lines
2217 bytes
markd@werple.net.au (Mark Delany) wrote:

>It would be a mistake to under-estimate the effort in developing an
>article storage API for INN. It will be a hard and largely thankless
>task. James could easily spend many months of work on 1.6 and end up
>with a one-line change file saying "INN now supports an article
>storage API".
---------------------------------------------------------------------
Perhaps I should wait for a comment from the "guilty parties"
who are working on 1.6.  :-)   But....

I know Brad's idea would require a heap of mess of work.

I just plan to change the file name.  In fact, if you wanted
you could keep the history database intact and run expires as
usual.  (They would be much quicker because all the
files in a directory would get expired at once, not to mention
having smaller directories.) 

My quick tour of the art.c code shows a couple of lines that
need to get changed.  (The lines around ARTwrite() call.)
And just null out all that symlinking.

It would seem that most of the hassle to make my idea fly
is to rewriting nnrpd to fetch an article without relying
on its name being the group and number.

I'd like to discuss the implications I haven't considered,
if the scheme I outlined would be of benefit, and if anyone
else had already done it, and if there was interest.

(OTOH if a storage API is going to be part of 1.6, and 1.6
is coming out in the next three months, then I'll just
sit back and wait.)

Forrest Cavalier
Mib Software


Re: Redesign spool and history database
#14854
Author: Darrell Fuhriman
Date: Fri, 07 Feb 1997 00:00
21 lines
1139 bytes
mibsoft@epix.net (Forrest J. Cavalier III) writes:

> 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.

Undoubtedly.

> 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?

Mr. Brister is working on one, and will release it in the future
(soon, I hope).  I don't know what the status is now, though.

Darrell Fuhriman



Re: Redesign spool and history database
#14871
Author: Mark Delany
Date: Sat, 08 Feb 1997 00:00
49 lines
2690 bytes
mibsoft@epix.net (Forrest J. Cavalier III) writes:

>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?

Without wanting to put words into his mouth, as I understand it, James
Brister @ ISC has made it fairly clear that an article storage API is
fairly high on his list of priorities. I further understand that one
of the serious database suppliers have expressed interested in
grafting their database engine underneath INN.  An API is obvously
necessary, not only for them, but also for the variety of other ideas
that have been expressed in various places at various times (mine is
just one of a number of possibilities). Many readers of this group
will also know that NNTP is undergoing changes that will almost
certainly require more sophisticated storage techniques.

It would be a mistake to under-estimate the effort in developing an
article storage API for INN. It will be a hard and largely thankless
task. James could easily spend many months of work on 1.6 and end up
with a one-line change file saying "INN now supports an article
storage API".

It would also be a mistake to under-estimate the potential of an
API. Searching, archiving, sophisticated expiration policies and
dramatic I/O reduction all become possible.

It is my humble opinion that an API will pave the way for a quantum
improvement to INN and news processing. I have no affiliation with
ISC.ORG but helping them to provide such an API can't only be a Good
Thing.


Regards.

Re: Redesign spool and history database
#14879
Author: Scott Lystig Fritchie
Date: Sun, 09 Feb 1997 00:00
40 lines
2554 bytes
mibsoft@epix.net (Forrest J. Cavalier III) writes:
> Thread from 4/17/1996 (or there abouts) described a feeder only
> solution which stored articles under directories and files based
> on MD5 hash of the message ID.

FWIW, see http://www.mr.net/~fritchie/HASHHACK/.  I haven't done any
further development work on it, but I'm aware of one "Top 20" site
which has been using it for months.

> To summarize, I think my idea has one significant
> improvement: use an expiration table to map hash values
> to an expiration code, and then use the expiration code as
> the top-level directory.  

Expiration of all those separate files is still a pain, particularly
with filesystems that do that sort of thing synchronously.  But you
eliminate a lot of needless reading & rewriting of directory inode
info ... to the tune of a roughly 2-3x performance boost in my
off-the-cuff not-well-controlled testing.

To echo what I said a few weeks ago in the innfeed-users (?) mailing
list -- I've been holding off further refinement of my circular buffer
storage method until James Brister finishes the API.  What the code
I've grafted onto innd & friends is ugly, gross, perhaps unnatural,
but certainly difficult to maintain.  Thanks to Darrell Fuhriman for
moving it to 1.5, but I'd rather not put him (or anyone else) through
it again.  ... Imagine, having a commercial relational database for
backend article storage.  Or a Tandem.  Or an entire network of
Commodore VIC-20s with cassette tape drives and 16K RAM expansion
cartridges.  What a sight....

-Scott
---
Scott Lystig Fritchie, Network Engineer          MRNet Internet Services, Inc.
fritchie@mr.net, PGP key #152B8725               Minnesota Regional Network
v: 612/362.5820, p: 612/637.9547                 2829 University Ave SE
http://www.mr.net/~fritchie/                     Minneapolis, MN  55414

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads