🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #38682

Re: Musings upon the concept of creating reliable news services with redundant sets of unreliable servers....

#38682
From: Joe Greco
Date: Wed, 14 Jul 1999 00:00
273 lines
14984 bytes
In news.software.nntp article <19990714184455.693$oy@newsreader.com>, curt@kcwc.com (Curt Welch) wrote:
:jgreco@ns.sol.net (Joe Greco) wrote:
:> In news.software.nntp article
:> <brad-1407991832480001@brad.techos.skynet.be>, brad@shub-internet.org
:> (Brad Knowles) wrote:
:
:> :    I've been thinking about this problem quite a bit within the last
:> :few days.  The goal is to avoid Single Points of Failure (SPOFs), and
:> :what I've had rattling around in the back of my brain is something along
:> :the lines of RAIS (Redundant Arrays of Inexpensive Servers [0]).
:
:I've been thinking about that type of design for years.  It's always
:sounded very appealing to me.  Creating a network of cheap servers
:is easy to do where as trying to create one large server with the same
:power is far more expensive.
:
:It's why I started writing my own news server back in December.  I wanted
:to create an archetecture which would allow the server do be distributed
:over a redundant array of cheap servers.
:
:> You are going in the right direction, you just don't have the right
:> technology.  You want big spool servers.  Machines that have lots of
:> disk and lots of speed but aren't being bogged down by dealing with
:> the inane stuff clients like to spew at a NNRP daemon.  You want
:> smaller reader servers.  Machines with small amounts of disk that
:> handle the NNRP transactions.  Machines that handle managing the
:> overview data, active files, etc.
:>
:> You want to replace NFS with NNxP.
:
:This is just what I've done with my new server.  I just put
:it into production on NewsReader.Com two days ago replacing my old
:inn server.
:
:> Look at Diablo.  Matt Dillon has done a fantastic job of solving your
:> problem for you.  You set up reader boxes running dreaderd.  These
:> accept a header-only feed from a master server, and create an overview
:> database from the Xref: data and other headers.  This is very low-cost
:> in terms of bandwidth, etc.  Each reader can handle hundreds of users,
:> and talks to the spool servers via a dozen or so NNTP channels which
:> are used for "ARTICLE <mess@geid>" type retrievals - very easy and very
:> fast for the spool server to do.
:
:I haven't really looked at what Matt's done so please excuse me for being
:stupid about this...
:
:So each reader box maintains it's own overview database which includes the
:indexes required to map group/article# into message-ID? 

That's actually _all_ the overview databases are...  headers from the
actual Usenet articles, stored in an index to map group/article# to
header.  That information naturally includes the MID.

:How do they know
:when an article has expired from a spool server?

They don't.  It is actually an extremely elegant design, because it allows
so much flexibility.  You can have a small local spool under your admin
control, and then also have a slower "backup" link to someplace like
newsreader.com or remarQ.com which retrieves articles not found on the
local spool.

Realistically, there is no good general way to keep the overview and
spools completely sync'ed and yet maintain the ability and flexibility to
keep them on separate machines or even separate administrative realms.

You can design more complex mechanisms that greatly reduce your
flexibility in what clever things you can do...  but this adds great
quantities of complexity.  What if you have lots of "small" spools,
each of which hold the last week of news, but you choose to have one
"retention" spool in your company that holds the last month of news?
Even assuming you had some hypothetical package that allowed the
overview database to know when the articles had been removed from
the spool, the overview database would still have to be clever enough
to wait for the last instance of the article to vanish from the spool
servers before removing the overview data.  What about a heterogeneous
environment where one of the spool servers isn't even the same software
package?  Right now, my new Diablo servers rely somewhat on the current
INN reader system to provide some types of articles for which I have
not yet built Diablo spool servers.

:Is there some regular overview expire process which scans everything on a
:regular basis?  Or do the readers just expire their data based on their own
:logic (which might or might not match the back-end servers), or what?

Based on their own logic... which is theoretically based on what the
admin knows about the actual environment.  Querying each of potentially
dozens of spool servers to make sure that an article no longer exists
on any of them would be bad for a single reader, and disastrous for a
large number of readers.  You could do it, sure, but I don't think you
would _want_ to.

:What I did was to have each spool server number the articles sequentially.
:And then, instead of requesting articles by message-id, you get them by
:their number.  The storage scheem the servers use are set up to make this
:simple and fast for them to do.

Diablo makes it fast and easy for them to request by MID.  Different
way to implement the same general thing.  However, if you mean that you
are storing them by their group.name:number, then you are pushing extra
work up to your spool server because it is having to maintain those
indexes in some fashion or another.  The Diablo spool box just lays the 
articles down and writes history entries, and retrieval is equally
simple because the history lookup on the MID gives you the reference
to the actual article, which is then trivial to fetch and send to the
client.  It sounds like you have to go through some more complex
data to get to the actual message, although if it was coded very
efficiently, I guess it wouldn't be an issue.

:The numbers are designed to wrap at a fixed point so there's no problems
:with the numbers getting to large.  It only limits how many articles one
:server can store.

Same with Diablo, except that it is simply doing its normal expiration
thing and storing by MID.

:And, articles always expire from the spool servers in order.  So this
:means, that at any time, each spool has a range of current "valid" article
:numbers. The front-end server (which currently is also the master server)
:always knows what the current valid range is for all the spool servers -
:and it uses that to quickly know if any article is still valid, or if it
:has expired.

That sounds like more dependence than I'd personally like to see.  In my
environment, I don't care too much if I newfs my master, the only real
damage I might cause is due to the loss of history, so I might get some
duplicate messages showing up on the readers.  Whoopie.

:There's a group/article# to spool/spool-article# database maintained by
:the master server (though this could be dupped in all the front-end servers
:like Diablo).  So, to check to see if article #12345 in group x.y.z has
:been exired, all the server has to do is look up the spool, and article
:number on that spool, and then check that against it's table which is
:constantly being updated.

Oh, wait, your spool/spool-article# is not the same as group/article#?
Ich.  I see what you're trying to do, but I don't think I like it too
much.  It lacks the simple elegance of Diablo, although it may allow
you a particular form of flexibility in how you choose your retention
policy.

:This allows the front end overview information to stay perfectly in sync
:with the back end spool servers.  This way, you never report "old" overview
:info which could lead to extra "article no longer available" messages for
:the users.

I just make sure I keep the data on the spool servers longer than the
readers store the overview data.  I'll concede that that is tricky and
a bit speculative.

:It also comes into play in the history file managment.  Knowing if an
:article is still valid allows you to create a history file that starts
:small, and only expand if needed. If it's expensive to figure out if an
:article is still valid, then you have to use a fixed size history file and
:force the admikn to make sure it's big enough (like Typhoon), or expire
:later instead of in real time (like old Diablo at least).

Diablo still does batch expiration.  It has not shown itself to be any
sort of bottleneck in my experience.  The Diablo reader stuff uses a
dynamically sizing (and it uses some method I don't like, I plan to
look at this soon and change it) overview index on a per-group basis.

:> I'm heavily committed to this paradigm at this point.  It is conceptually
:> correct.  Your back end spool servers can be anything that is able to
:> answer "ARTICLE <mess@ageid>"...  INN, Typhoon, Diablo.  Your front
:> end reader servers are small and cheap to build.
:
:I've even been looking a bit at low-end consumer PCs to use as the spool
:servers.  They are so cheap these days that you can get an entire PC with
:large IDE drives for less money than a bare SCSI drive of the same size.

Yeah, I considered that for some other purposes...  using a Promise (I
think) IDE controller in addition to two on-boards, one can get four
IDE channels and eight IDE drives on a single system, which reduces the
cost overhead of the PC somewhat.  I still like SCSI better, since I can
put hundreds of drives on a single machine, and I have a lot more faith
in SCSI to handle server-class loads.

:I'm not sure how well they would actually perform, but it's an interesting
:idea made possible by this type of architecture.  And since ethernet is hot
:swapable, it's easy to replace these things on the fly (assuming your
:software is set up to deal with that).

It should be!

:> I'm currently shooting to build such a system that will scale into the
:> millions-of-subscribers range.
:
:Yeah, I too am heading towards that.
:
:> I've solved a number of scalability
:> issues,
:
:I have the structure in place to do a lot of this, but currently
:the master server is doing all the reading as well, so it doesn't
:yet scale well - still needs more code....
:
:> Yes, you still have a SPOF... the master server.
:
:And most likely you will have some networking hardware which is also
:a SPOF.  But if the reliability is high enough, this is fine.

With dual Ethernets and other arrangements as well, I can eliminate the
networking hardware as a SPOF.  One requirement in my current design is
that everything have at least two paths to each primary spool server.

:And the later it is said:
:> :    I'm confused regarding how articles flow from the master server to
:> :the news spool servers.  I think I understood the rest.
:>
:> Uh, actually, im my implementation - they _don't_.  Articles flow from
:> the news spool servers (where article numbering is irrelevant and
:> useless) in _to_ the master server.  This is simply to assure that an
:> article is there on at least one spool server before the master assigns
:> it a number and passes that on to the reader machines.
:
:Interesting twist.  In my design, the master gets a full feed, assigns the
:article numbers (and updates the Xref header in the article), then sends
:the article to a spool.  The spool assigns it's spool-number to the
:article, and returns that info to the master.  Only then (after the master
:knows for sure the spool correctly saved it) does the master update the
:overview-like database and make the article "visible" to NNTP clients.  My
:master also keeps two high water mark values for each newsgroup.  One is
:used for assigning new numbers, but the second is only updated to reflect
:when articles are stored and made visible to the NNTP clients.  The NNTP
:clients only see the high-water mark that correctly matches what is
:currently available for them to read.

That's nice, but almost required for your stated design.  I get away with
only having to worry about making sure that it is available on _some_
spool server in the pool, and by arranging the feeds such that the master
only gets articles from the spool servers, that is actually designed right
in and guaranteed by the setup.  Other than that, Diablo is doing the
same basic thing with a lot less chattiness...  when the master hands the
reader a header, it becomes "available for reading".  There is a potential
window where it is available on A but not B, but that will happen to yours
too as you scale it, I believe.

:What do you do about the Xref: line?  When you read an article does the
:reader box insert it on read?  Or do you just not get Xref: lines from your
:system?

This is one odd thing.  But it is a side-effect of policy decisions that
I have made, it is not really a Diablo restriction.

When you ask for "ARTICLE 1", Diablo provides the header from the overview
(which of course has an Xref: for sync purposes) but searches the spools
for the body of the associated MID in the overview.

When you ask for "ARTICLE <x@y>", Diablo searches the spool servers
directly for "<x@y>", and returns the complete article.  This makes sense
since the reader code does not maintain a history, and cannot map that
request to an overview entry.

In my particular design, then, no, you don't get an Xref: line.  If that
bothers you, you can design it such that the spool servers are fed by the
master and do get Xref: lines, but then you lose the automatic availability
guarantee that we just discussed, and you have to make sure that your spool
servers will have the article.

You could do this by making the master Xref: the articles and feed the
spools, then have the spools provide the header-only feeds to each of the
readers.  But, then in my case, you are hauling more data than necessary
around across your network - which is why I decided against doing that.

Or you could fudge it and hope for the best.

Either way, I like the "lego effect" Matt has built into the overall
design of the system, you can do lots of neat and cool things.

... JG

Technical Details
Message-ID: <378d4353$0$374@news.execpc.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
References: <brad-1407991832480001@brad.techos.skynet.be> <378cc595$0$374@news.execpc.com> <19990714184455.693$oy@newsreader.com>

Show Full Headers
Complete Article Headers
Message-ID: <378d4353$0$374@news.execpc.com>
Subject: Re: Musings upon the concept of creating reliable news services with redundant sets of unreliable servers....
Date: Wed, 14 Jul 1999 00:00:00 +0000
From: jgreco@ns.sol.net (Joe Greco)
References: <brad-1407991832480001@brad.techos.skynet.be> <378cc595$0$374@news.execpc.com> <19990714184455.693$oy@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!not-for-mail
X-Deja-AN: 501165817
Sender: jgreco@earth.execpc.com
X-Trace: nreader1.newsops.execpc.com 932004691 374 jgreco@169.207.16.1
Organization: sol.net Network Services - Milwaukee, WI
Newsgroups: news.software.nntp
X-Complaints-To: abuse@execpc.com