🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #18224

Re: INN Performance Patch

#18224
From: Matt Dillon
Date: Wed, 04 Jun 1997 00:00
153 lines
8979 bytes
:In article <Pine.BSF.3.96.970604101700.4250A-100000@super-xenu.radio.cz>,
:Ugly Boy  <ag786@yfn.ysu.edu> wrote:
:>On Wed, 4 Jun 1997, Jeff Garzik wrote:
:>
:>Hmmmm, optimizations to err on the safe side, perhaps (or pessimizations
:>depending on how you look at it):
:>
:>> The logic is like this:
:>> 
:>> IHAVE
:>>     if (pre-committed)
:>> 	Refuse
:>
:>At this point and below, instead of refusing it (since the transfer is not
:>yet complete and there is a very slight danger you won't get the article),
:>you could return the Defer (431/436) code, to force the other peer to try
:>again.  The situation could arise where all but one of your peers has the
:>article with winternet in the path, and that one peer from which you would
:>accept the article offers it at the time one of the other sites has caused
:>the message-ID to be in your pre-commit cache.

    Deferal responses do not work.  In fact, they cause a stable degenerate
    case to occur that can blow a news server up.  The problem is that
    when you return a deferral code, you have no idea what the client on the
    other end is going to do.  Most clients will *RETRY* the article over
    and over again until they get a refusal or are told to send it.

    In a multiple-feed situation, this can and will result in a bunch of
    fast feeds getting 'stuck' behind a slow feed that has gotten a precommit
    lock on a message-id that all the fast feeds want to send.  The slow
    feed will often be able to complete processing and precommit the next
    message-id before the fast feeds can 'move on' to the next message-id,
    causing a backup to occur.  The entire news system is reduced to the 
    speed of the slowest feed.

    No high speed news transit system worth its salt will even contemplate
    returning a deferral, which means the only responses available are 
    basically 'I have it already' or 'send it to me'.


:>Granted, it's highly unlikely, but you're always taking a risk if you
:>refuse an article before it's completely transferred.  I usually see a
:>couple dozen or so articles which somehow get mangled in transit each day
:>and thus need to be transferred a second time for success.  And we all
:>know what happens when part 175 of a multi-part post is missing.

    If you have multiple feeds, this is not usually an issue.  If you have
    two feeds, and want to guarentee 2-way redunancy for connection failures,
    get two feeds that are out of sync with each other.  Also, if you do
    not acknowledege the article you gave the go ahead for, and the connection
    dies, then the feed that you gave the go ahead to will resend the article
    anyway after it reestablishes the connection.  So, really, it is not an 
    issue.

    In fact, in a two-feed situation, you WANT to get two feeds that are
    out of sync with each other if only to handle the case where your machine
    crashes.

:>This is another window of vulnerability when an article can be duplicated,
:>when several peers have given you the CHECKs simultaneously, you've
:>responded affirmatively to them, since nobody has actually gotten around
:>to the low-latency IHAVE or reached the point of beginning the transfer
:>with the TAKETHIS.
:>
:>Depending on the number of CHECKs the peers are giving you and the latency
:>and bandwidth between you and size of articles to be transferred, there

    The whole point of a precommit cache is to avoid this situation.
    It isn't a precommit cache if it doesn't pre-commit :-) The first 
    check for a message-id locks that message-id.  Checks coming from 
    other feeds get an immediate 'I have it arleady' response.  However,
    you do bring the point:

:>Just how one would treat a situation like this is dependent on your
:>concern and/or greed.  If your biggest worry is how much fame, wealth, and
:>fortune you will receive in exponential proportion to your status in the
:>top 1000, you want to take the article from whoever gets it to you first,
:>so you probably would dispense with refusing or deferring articles based
:>on the promise that they're on their way.  Then, if you want to absolutely
:>minimize the amount of bandwidth wasted by multiple transfers of the same
:>article, you're going to want to add it to the pre-commit cache as soon as
:>the first peer mentions it to you, even though it would be possible for
:>another peer to offer a CHECK and receive a Roger and get the article to
:>you before your first peer clears out previously acknowledged articles and
:>finally gets around to the TAKETHIS.

     Yes, absolutely.  However, the people that actually try to implement
     the 'take it from everyone who offers it' approach have a number of
     hurdles to pass.  The problem is, again, a STABLE degenerate case
     in the algorithm whereby all the incoming feeds offer the article
     at the same time and are told to send it.  If you have 50 incoming
     feeds, you have 50x the incoming bandwidth that you would have otherwise.
     And this is a *STABLE* degenerate case... the feeds will tend to stay
     IN SYNC.  Once the machine gets locked into it, your incoming bandwidth
     will explode and probably take the machine with it.

     There are a few ways around this... you can allow two locks on the
     precommit cache rather then one, so two different feeds are given the
     go ahead while the others are told to skip the message.  This way the
     degenerate case is only 2x the incoming bandwidth that would otherwise
     be required.  Since a newsfeed is around 50 KBytes/sec 24 hours a day,
     even the 2x degenerate case can blow up some poor sod's T1 :-)

     I don't think it's worth it, and Diablo doesn't do it.  Diablo (1.09)
     uses a precommit cache that locks on the ihave/check command and has
     a 30 second timeout.  There are no degenerate cases, which means it
     will remain stable under all sorts of adverse conditions.  The 
     possibility of loosing an article due to a precommit collision is
     basically zero.  Sure, you will not necessarily receive any given
     article the quickest possible way, but Diablo doesn't cater to that
     crowd.  In my eyes, a 50 mS lag in receiving an article is just fine
     if it means the news transit system is guarenteed to be stable.

:>Another thing to note, for sites such as myself with multiple news
:>servers, is that pre-commit caches are spiffy when all feeds point to a
:>single, sometimes overburdened machine.  But when a site chooses to split
:>incoming feeds among multiple machines for redundancy, and particularly
:>when these machines are not perfectly synchronized, two or more sites can
:>easily be sending the same articles at the same times as there's no way
:>for the two servers getting the article to know that it's already coming
:>in to the other.  I see ten or so thousand duplicated articles this way
:>with just two supplementary feeds to my secondary server, which is less
:>than 5% of incoming articles, but possibly a significant volume if many of
:>these are large binaries.  I could reduce this by asking those two sites
:>to aim at my overworked incoming server, and then have only the slowest
:>sites feed the other machine as backup.

    I think this is a necessary evil.  I have about 20 full feeds, 10 of
    which are mostly synchronized with each other, and 5 of which are 
    synchronized within 50 mS of each other, and I kid you not!  Maxwell 
    has feeds that are synchronized within a few milliseconds of each other.
    It's pretty insane.

    If I were to split my incoming feeds across two machines, my incoming
    bandwidth would plain and simply double no matter what I did.

:>> Almost mind-numbingly simple.  :)
:>
:>Yeah, and I twist it into this overly-long drivel.  Ah, well, I've written
:>enough for this time of day, with the clarity of what I write proportional
:>and the quantity inversely proportional to the hour of the day.
:>
:>Barry Bouwsma   http://www.netscum.net/bouwsmb0.html
:>news.radio.cz admin in scenic sorta sunny Brno, Czechia

    Heh.

						-Matt



Technical Details
Message-ID: <5n4m8l$l97$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-mail
References: <5mt7et$s52$1@turing.mathworks.com> <Pine.BSF.3.96.970604010244.3585A-100000@super-xenu.radio.cz> <3395099D.1A6AB61@spinne.com> <Pine.BSF.3.96.970604101700.4250A-100000@super-xenu.radio.cz>

Show Full Headers
Complete Article Headers
Message-ID: <5n4m8l$l97$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> <Pine.BSF.3.96.970604010244.3585A-100000@super-xenu.radio.cz> <3395099D.1A6AB61@spinne.com> <Pine.BSF.3.96.970604101700.4250A-100000@super-xenu.radio.cz>
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: 246142056
Organization: Best Internet Communications, Inc. - 415 964 BEST
Newsgroups: news.software.nntp