Article View: news.software.nntp
Article #7410Re: Storage of Usenet News Articles by MD5 Hash
From: Evan Champion
Date: Thu, 09 May 1996 00:00
Date: Thu, 09 May 1996 00:00
87 lines
4660 bytes
4660 bytes
jerry@strobe.ATC.Olivetti.Com (Jerry Aguirre) wrote:
>One could instead generate the directory based on the time of article
>arrival. By example suppose we generate the directory name based on the
>day of month, hour, and minute. It would store the typical few hundred
>articles that arrive during that minute on one directory. Then it would
>move on to the next directory.
For people running 1 disk that would probably be the best plan. What
about running more than 1 disk in a non-RAID configuration, however.
Storage by message ID will remove the dependence on symlinks and
depending on the method it has the potential to allow people to just
keep adding disks without having to worry about RAID hardware or
software.
Given the following spool directory tree
/var/news/spool/disk1 -> 128 directories -> 128 more etc
disk2 -> 128 directories -> 128 more etc
disk3 -> 128 directories -> 128 more etc
It should be more efficient to have INN spray the articles over disk
1, 2 and 3 first rather than by date or time.
>The advantage over the message ID is that articles are stored grouped
>by arrival time instead of by newsgroup. For a feed site this means that
>not only does storage result in less seeks but transmission as well. The
>queue of a newsfeed will also be generated in directory sequence without
>having to sort it.
That is certainly an advantage.
>The disadvantages are that:
> - It is no longer possible to go directly from message ID to
> article pathname. The history file would need to contain
> the generated pathname. (Actually the INN history contains
> the arrival date so that is part of the needed information.)
That isn't really an issue for me, and I assume it isn't for most
other admins. All that I ask is that in the news log, full article
paths still (optionally) get logged so I can easily track down user
spams, etc. (just like today with the nntplink support defined).
> - readers would be at a disadvantage as to them reading a group
> would require jumping all over.
Unless there is an obvious performance hit, a reader shouldn't really
notice.
Of the "less work" methods, I think storage by message ID (preferably
in a way favourable to multi-disk systems) is the best way to do it.
Of the "more work" methods, I think the best performance etc. gains
are to be made by creating an INN file system and including things
like overview data right in with the article, so no separate overview
files and no expireover program. It could use a raw filesystem, or
for systems where this is difficult (ie: can't do raw filesystem
access after the system enters multiuser mode), create 1 file per disk
that spans the entire disk and then use it the same way you would a
raw partition. No (low) filesystem overhead, INN can internally cache
the filesystem tables for fast access, maybe even have the filesystem
record that a message ID was expired (without fully removing the
message ID) so you wouldn't need a separate history file. mmap() the
"directory" for each disk and then when expire (and nnrpd, and other
programs too perhaps) runs it could just attach itself to the
directory index without having to build an in-memory index itself.
Lots of interesting possibilities here.
I see the "more work" case, however, as perhaps inn 2.0 :-) The more
I think about it, the more that case looks like a database engine with
various clients. If that is the basis, then instead of having the
system set up the way it is today, why not either build a database
engine or use an existing one and instead of having it talk SQL have
it talk NNTP. Servers connections would work just like reader
connections, except they would have a different command set available.
Expire would be a database client which just runs around marking
articles as deleted. The INN "server" would be nothing more than
something that waits for a connection and then fork/execs the
appropriate client.
Evan
Technical Details
Message-ID:
<4mt0lg$eag@piano.synapse.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:
<4mrljr$ho@olivea.ATC.Olivetti.Com>Show Full Headers
Complete Article Headers
Message-ID: <4mt0lg$eag@piano.synapse.net> Subject: Re: Storage of Usenet News Articles by MD5 Hash Date: Thu, 09 May 1996 00:00:00 +0000 From: evanc@synapse.net (Evan Champion) References: <4mrljr$ho@olivea.ATC.Olivetti.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: 153886347 Organization: Synapse Internet [www.synapse.net] Newsgroups: news.software.nntp