🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #53581

Re: rate-limiting peers

#53581
From: Curt Welch
Date: Wed, 01 Aug 2001 05:23
82 lines
5347 bytes
"Eric A. Hall" <ehall@ehsco.com> wrote:
> Let's say that I have a peering session which has a lot of bandwidth but
> which also has a lot of latency, and I also have a couple of secondary
> peers with a lot of bandwidth but very low latency. If I am wanting to
> prevent the secondary peers from becoming my primary peers, could I
> introduce an artificial TCP rate limit on the secondaries to force them
> to stay behind?

yes.

> For example, if the secondaries had a bunch of articles, they would send
> the ones they could, until the primary had caught up (or passed them), at
> which point I would start rejecting articles from the secondaries (I got
> the other articles from the primary during the burst). With a bit of
> tweaking I could probably tuned this so that I was only getting localized
> feeds from the secondaries, while getting 80% from the primary.

One way this is done is have your secondaries run a delayed feed.  Many
servers can do that.  They simply hold the articles for a few minutes
before they try offering them to you - in effect introducing an artificial
latency in order to allow your high latency  cheap link (sat feed etc.) to
get the articles to you first.

> One problem I can see with this is that whenever the primary goes
> bye-bye, the secondaries would be sending everything, and would have to
> jam the feed during this period.

Another way to force the delay from your side is to limit the incomming
bandwidth of your secondary feeds to some constant amount.  This is
something I've just started playing with.  Not too sure how well it works
yet in practice.

If you normally get everything from your primary, and the secondary are
just for backups or for the few articles that were lost for some reason,
then if they are beating your primary feed, and sending you too much stuff,
their bandwidth usage will go up.  When they hit the limit, it will force
them to start to backlog, and the backlog will then stabilize at the point
where what they are sending you matches the bandwidth limit you set.

If your primary goes down, you don't get hit with a big increase in
bandwidth usage from your secondary feeds, because they were already
crusing at their limits (assuming they were beating you already).  But
because they are now having to send you a lot more, they will backlog even
further. When the primary comes back, the missing gap will still be filled
in from the secondaries, but slowly.  How well it works depends a lot on
where you have that bandwidth limit set and how long those secondary feeds
will hold a backlog for you before they start to drop articles.

The disadvantage of this system is if you set the bandwidth limit too low,
then the secondary will backlog until it reaches it's limit, and start to
drop articles.  That normally sucks because it just means you have added a
multiple hour delay into the system for no good reason.

> So things would be rough when the primary failed, but other than that,
> anything else wrong with this approach?

You didn't really expalin what algorithm/logic you were going to do to slow
down the peers.  Rate limit in bytes per second?  articles per second sent?
articles per second offered? what?

I think any of those options would tend to have the same danger I talked
about with the banndwidth limiting (i.e rate limit bytes per second).

I guess another more complex way to do this is to look at the articles
beeing offered by the primary feeds and every time you decline the offer
because one of your secondary feeds sent it to you first, you would record
that fact.

You could then slow down the secondary using one of the rate limiting
options based on how many articles it was pusing in front of your primary.
That way, if the seconday started sending you lots of stuff that the
primary for some reason was never offering you, the system wouldn't slow
down the seconday just because it was sending so much.  It would only slow
it down if it was sending too much of the wrong stuff...

The way my server is structured I could try implementing that idea...
Hum...

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Technical Details
Message-ID: <20010801012336.182$ie@newsreader.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!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!howland.erols.net!portc.blue.aol.com.MISMATCH!portc01.blue.aol.com!feed.newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
References: <3B6735C3.FF59F476@ehsco.com>

Show Full Headers
Complete Article Headers
Message-ID: <20010801012336.182$ie@newsreader.com>
Subject: Re: rate-limiting peers
Date: Wed, 01 Aug 2001 05:23:36 +0000
From: curt@kcwc.com (Curt Welch)
References: <3B6735C3.FF59F476@ehsco.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!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!howland.erols.net!portc.blue.aol.com.MISMATCH!portc01.blue.aol.com!feed.newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.nntp
X-Trace: NewsReader.Com GOno4_ptJesyYMo49j4o@Mic4R/8nHAkbz+fcfR+qON++OVi
X-Face: "p}G*1KH{+F7EYGKLb>ogDguabZ+%,?^epeFB!nzu`)`$=QcvL1KF6<0GH!Tbc!Sqo[|tV5
  %IW48mQf3K=Ci&gZ7]]aazx@]Y-nq!r5{yH/#,?@lDdUDvOfByB2hVW0.@OM%{l/{cT'{w
X-Url: http://CurtWelch.Com/
User-Agent: NewsReader.Com
Lines: 81