🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #40164

Re: Diablo vs. INN questions...

#40164
From: Russ Allbery
Date: Mon, 27 Sep 1999 00:00
54 lines
3241 bytes
Brad Knowles <brad@shub-internet.org> writes:

> For INN:

> 1.  When receiving an article, it is written into shared memory, and
> from then on only a pointer to this shared memory is passed around.

No, not quite.

Remember, INN is at its heart a monolithic daemon.  There's just one innd
process.  It handles incoming connections in a select loop and writes feed
data to outgoing connections as defined in newsfeeds.  So there's no
shared memory involved; there's just normal, ordinary heap memory.

> 2.  When executing the perl filter, a copy of the program is always kept
> running (a la apache w/ mod_perl), and a pointer to the article (stored
> in shared memory) is passed.

Under INN, the Perl filter isn't a process.  It's embedded directly inside
innd; innd links with the Perl libraries.  This is the reason why the Perl
filter is so much faster in innd than in the external process
implementation of Diablo and Cyclone.  Because innd is a monolithic
process, unlike Diablo's forking model, you can do that and still maintain
history across all incoming articles.

> 3.  When this article is to be offerred to one or more peers, a pointer
> to this shared memory is passed to the routine that writes the article
> to a spool file to be read by innfeed, and depending on the feeding
> method (0 to 3), if an innfeed process is not currently running or is
> not currently idle, a new one will be fired up to handle this article
> (up to the maximum simultaneous connections that have been configured).
> Otherwise the article id is written to one of the existing spool files
> via an algorithm that either guarantees absolute minimum latency to
> offer that article to a particular peer, or maximizes the number of
> articles per second, or some combination of the two.

No, innd doesn't know anything about outgoing feeds at all.  It just knows
how to write designated data to another program or to a file.  innfeed is
a separate process that handles all outgoing feeds in a standard
configuration; innd writes the article out to disk and then tells innfeed
its storage token and all sites that it should be sent to, and innfeed
reads it back in from disk and blasts it out to those sites, opening new
connections as necessary.

If INN were really using shared memory, you could take the disk out of
that loop, and then INN would have a latency comparable to NNTPrelay or
Cyclone.  Similarly, if you were to thread innfeed and then make innd at
least thread-safe, you could just pass the article in memory to an innfeed
thread and get similar speed.

-- 
Russ Allbery (rra@stanford.edu)         <URL:http://www.eyrie.org/~eagle/>

Technical Details
Message-ID: <yl4sggteag.fsf@windlord.stanford.edu>
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-2709991944100001@brad.techos.skynet.be>

Show Full Headers
Complete Article Headers
Message-ID: <yl4sggteag.fsf@windlord.stanford.edu>
Subject: Re: Diablo vs. INN questions...
Date: Mon, 27 Sep 1999 00:00:00 +0000
From: Russ Allbery <rra@stanford.edu>
References: <brad-2709991944100001@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: 529965841
Organization: The Eyrie
Newsgroups: news.software.nntp