Article View: news.software.nntp
Article #18225Re: INN Performance Patch
From: Matt Dillon
Date: Wed, 04 Jun 1997 00:00
Date: Wed, 04 Jun 1997 00:00
61 lines
3524 bytes
3524 bytes
:In article <3395099D.1A6AB61@spinne.com>,
:Jeff Garzik <jeff.garzik@spinne.com> wrote:
:>Ugly Boy wrote:
:>> I have to wonder about this -- while it certainly is of benefit to
:>> refuse following references to an article which is in the process of
:>> being offered (are CHECKs included as well as IHAVE or TAKETHIS?) where
:>> bandwidth is concerned, there always remains the possibility that a
:>>...
:>Certainly, that is the danger of all precommit caches. However,
:>presumeably the relatively small size of the precommit cache will mean
:>that by the time the article is offered again, seconds or minutes or
:>hours later by another peer, the hash will have been overwritten,
:>...
:>
:>Being connected to so many fast sites means that I'm very likely to get
:>an article offered to me multiple times simultaneously. From looking at
:>the code, INN appears to accept the transfer of all articles, and flag
:>the ones that arrive later as "trash" so the later articles are
:>...
:>A better solution would be to timeout each precommit after 30 seconds
:>(like Diablo), rather than wait until the hash is overwritten, but I
:>went for simple rather than complete. (Or slack rather than complete.
:>:))
The precommit stuff I implemented in Diablo works really, really well.
It doesn't catch everything, but it catches enough. I think you
should definitely put in a timeout, though... it's real easy to
do. Just store the current time in the cache record. When you
go to lookup something in the cache, and find a valid record,
check the current time against the time in the cache record.
If the difference is more then +/- the cache timeout (30 seconds
in the case of diablo), you just act as though a cache-miss
occured. (you have to check for negative deltas in case the
system's time-of-day gets adjusted backwards).
The precommit cache is designed to fill the window inbetween the
ihave/check for the message-id and the actual commit of the message-id
to the history file after the article is completely received, so
the cache entries need only last long enough to cover that short
period of time. Once an article is commited to history, the
history file lookups take care of longer-term duplication.
While there is a small chance that the precommit will scrap a
potentially valid push and allow one that 'fails' in the middle
of the transfer, the same article will almost certainly be
offered at a later time by another feed, so the precommit is,
in fact, very robust.
:>Almost mind-numbingly simple. :)
:>--
:>Jeff Garzik
:>News Administrator, Spinne, Inc.
:>http://www.spinne.com/usenet/
Yah, simple algorithms are always the best algorithms.
-Matt
Technical Details
Message-ID:
<5n4ecs$2a0$1@flea.best.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:
<5mt7et$s52$1@turing.mathworks.com> <33948068.4F305FB8@spinne.com> <Pine.BSF.3.96.970604010244.3585A-100000@super-xenu.radio.cz> <3395099D.1A6AB61@spinne.com>Show Full Headers
Complete Article Headers
Message-ID: <5n4ecs$2a0$1@flea.best.net> Subject: Re: INN Performance Patch Date: Wed, 04 Jun 1997 00:00:00 +0000 From: dillon@flea.best.net (Matt Dillon) References: <5mt7et$s52$1@turing.mathworks.com> <33948068.4F305FB8@spinne.com> <Pine.BSF.3.96.970604010244.3585A-100000@super-xenu.radio.cz> <3395099D.1A6AB61@spinne.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: 246116107 Organization: Best Internet Communications, Inc. - 415 964 BEST Newsgroups: news.software.nntp