🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #40438

Re: INN maxed? Time to add a Diablo router?

#40438
From: Joe Greco
Date: Mon, 04 Oct 1999 00:00
133 lines
6752 bytes
In news.software.nntp article <brad-0410991800210001@brad.techos.skynet.be>, brad@shub-internet.org (Brad Knowles) wrote:
:In article <37f8c10e$0$7751@news.execpc.com>, jgreco@ns.sol.net (Joe
:Greco) wrote:
:
:> You're insane.
:
:    Well, I did admit (a while back) that it had been over ten years since
:I had done any real programming, and that I was hoping to be able to use
:hacking on Diablo as an excuse to get my hands dirty again.

Lucky for you, nothing significant has happened in the last ten years.

:    I am not surprised by my lack of knowledge of things related to system
:programming, but I figure there's only one real way to learn -- make
:mistakes and actually try them.

Time consuming and frustrating, at least when you're talking on the scale
of a complete news system.

:    I don't know whether a lobotomy would help me become a better system
:programmer, but if that's the case, then maybe I don't want to try to find
:an excuse to get my hands dirty again.

:-)

:>                                                            Diablo is most
:> of what you'd want to see in a news reception engine.
:
:    Given that explanation, I think I have a slightly better (up to
:0.000000001% now) understanding of the Diablo architecture, etc....

It's very simple.  You have Diablo, all Diablo does is receive news.
dnewslink and friends are unrelated backends.  Ignore them.

Diablo is "diablo", and has a master process, which accepts new
connections, forks children to handle them, and then handles the
outbound feeds.

The children receive news from the remote peers, doing history lookups,
writing the article to the disk, and then telling the master process
what was received (which the master then hands to the outbound feeds).

That's it, in a nutshell.  Elegant and simple.

:>                                                               You'd want to
:> pull the filter processing out of the main process.  This almost certainly
:> would involve a dedicated child subprocess and some rather interesting IPC,
:> but could be done.
:
:    This could either be done with shared memory and the existing forking
:daemon model, or with threaded processing, right?

Yes.  In the event of threaded processing, you "virtually" still have
shared memory, and need to arbitrate between threads just like you would
for the forking model, but in reality it is just a hunk of sbrk'd (yeah
yeah I'm a dinosaur) memory within the monolithic process.  It is _used_
the same way as the shared memory in the forking model though.

:>                          Doing the same thing to the outbound feed process
:> would also help, and would trivialize the master Diablo process into mostly
:> accepting new connections.
:
:    Hmm.  Wow.  Yeah, that'd be pretty cool.

Not really.  But it'd probably open Diablo up to more complex types of
feeds.  I used to be able to mail myself articles from /newslib/newsfeeds.

:> However, Diablo's real shortcoming is its outbound feed system, which is
:> where INN has some strength (sigh!)  innfeed has some of the same pitfalls,
:> being select-oriented, but at least you can have several of them running,
:> to gain concurrency.
:
:    Running the outbound feed process as a separate thread wouldn't help
:solve this problem?

In Diablo?  Sure it would.  Diablo's threading model, though, is process
oriented.  Has the advantage of being incredibly portable, automatically
works with SMP, and offers several layers of protection that monolithic
process threading doesn't.  So you could just add it as a separate process
and work with the existing model.  Or you could thread the Diablo process
and then do the outbound feed process that way.  I just wouldn't think
that you would want to put the outbound feed process as a separate thread
in the current model.

If you want to get more sophisticated, then you also bring realtime 
dnewslink into the monolithic mess.  Then you build an internal allocator 
to cache some news (like all articles < 50K for the last 30 seconds) and 
front-end your spool access API so that writes to spool happen
asynchronously (another thread) and reads from the realtime dnewslink 
check your "cache" first.

Now your model is:

Thread receives article, passes to feed thread, queues article for write
Feed thread feeds to various outbound-to-site-N threads
Outbound-to-site-N thread feeds to remote site, fetching from the cache
if possible
Spool writer writes from queue

So low latency connections are actually getting fed articles that may
not have been written to disk yet.

Then you rename Diablo to Cyclone.

(Sorry Rob/Highwind, heh)

But you still do non-realtime or backlogging feeds with external
dnewslinks, which of course you could also bring into the main threaded
process for some additional processing penalties.

:> Ultimately, you want to write a monolithic news system that is either
:> threaded at the kernel level (more ideal) or uses async disk I/O (less
:> ideal but OK for non-SMP).  One of the Sedores mailed me some new news
:> server code that implements this, but I've yet to find the time to putz
:> with it :-( :-( :-(
:
:    Uhh, I'm already running on SMP machines, and the idea of fully async
:disk I/O scares the heebie-jeebies out of me -- the same way that async
:mounted filesystems under Linux or FreeBSD scare me.

No.  See aio_read/aio_write

:    Myself, I would prefer to do I/O on the outbound feed system as
:non-blocking pipes or sockets, with file I/O reserved for overflow and
:delayed feeds.  In that case, file I/O could be buffered or otherwise done
:pretty much however you want in order to get maximum efficiency.

That's what INN tries to do, but INN got it wrong in lots of cases in my
experience.

... JG

Technical Details
Message-ID: <37f95476$0$7750@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: <foo-0210991412200001@192.168.2.3> <brad-0410991314520001@brad.techos.skynet.be> <37f8c10e$0$7751@news.execpc.com> <brad-0410991800210001@brad.techos.skynet.be>

Show Full Headers
Complete Article Headers
Message-ID: <37f95476$0$7750@news.execpc.com>
Subject: Re: INN maxed? Time to add a Diablo router?
Date: Mon, 04 Oct 1999 00:00:00 +0000
From: jgreco@ns.sol.net (Joe Greco)
References: <foo-0210991412200001@192.168.2.3> <brad-0410991314520001@brad.techos.skynet.be> <37f8c10e$0$7751@news.execpc.com> <brad-0410991800210001@brad.techos.skynet.be>
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: 532889762
Sender: jgreco@earth.execpc.com
X-Trace: S=T[4Gb?NPQI5[332>a9Y[bfNiaEHUgJWRYcgIRLSUE]LQ0=Onbg:oU7S5DdLOJ\M^21Vkhja922Vl=jlCRBl;3S4dTgmFn@ShW
Organization: sol.net Network Services - Milwaukee, WI
Newsgroups: news.software.nntp
X-Complaints-To: abuse@execpc.com