🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
90 messages
90 total messages Page 2 of 2 Started by Bill Gunshannon Mon, 26 Apr 1999 00:00
Page 2 of 2 • 90 total messages
Re: News server architecture (was: Submitting to Freenix)
#38295
Author: Russ Allbery
Date: Sun, 27 Jun 1999 00:00
24 lines
1891 bytes
Richard Michael Todd <rmtodd@intrepid.ecn.ou.edu> writes:

> The portion of ov3.c that's most reliant on the use of mmap is probably
> the handling of the group.index file (which contains, basically,
> up-to-date group hi/lo data and the inode numbers of the current
> per-group overview files.)  The remaining portions of ov3.c would be
> fairly straightforward to make in both mmap() and non-mmap() versions.
> You could probably get the group.index code to work non-mmap() too,
> replacing each array lookup with a read() call, but I'm not sure you'd
> like the efficiency.

Any reason why you can't do the same thing we used to do with the active
file in nnrpd and just re-read it into memory on a periodic basis?  Or
even take another step of advancement forward and resurrect actived?

Seems like it's the same problem.  I'm all for mmap() as a solution, but
we should probably provide a fallback.  It should be relatively clean to
do so, if we have a simple API; you don't even have to inject code in that
many different paths.

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

Re: News server architecture (was: Submitting to Freenix)
#38296
Author: Aidan Cully
Date: Sun, 27 Jun 1999 00:00
48 lines
2894 bytes
In news.software.nntp, bill@twwells.com (T. William Wells) wrote:
> In article <7l5p6n$1kf$1@news.panix.com>, Aidan Cully <aidan@panix.com> wrote:
> : > > Lovely. Someone *needs* to look over code and say "You can't DO that!"
> : > > and this mmap() thing is exactly the sort of thing I'm referring to. I
> : > > can't conceive of any reason to *require* mmap in any system, since it
> : > > doesn't provide any *functionality* that regular I/O calls
> : > > provide. Efficiency, yes, but functionality no.  So code that *requires*
> : > > mmap() is *broken*.
> :
> : That's a bit harsh, and I can't say I agree with you..  Read "shared
> : memory w/disk backing" again. :-)
> 
> And what exactly do you think a buffer cache is?

Not shared.

> Oh, sure, there's
> some extra CPU involved in copying the data around but the reality
> is that the CPU time isn't the problem, the overview *data
> organization* is (was?) the problem.

The problem is that you end up working with copies that may or may
not be out of date, and to check if it's current you'd need to get
_another_ snapshot out of the buffer cache, and compare the two
copies you've made.  With the current organization of the overview
data, that looks like two read()s of the overview.IDX's header for
each read of the overview.DAT file.  That's fairly annoying.

> Sigh. I think I'm too old -- the programming school I come from
> believes in portability and correctness rather than convenience
> and hack-it-out-the-door. And, yes, one can have good, fast,
> portable, and *timely* code; good programming more often results
> in faster delivery time than not.

It's not bad code.  (I don't think it is, anyway.)  It just uses
mmap.  Given the way INN (and specifically nnrpd) work, I don't
consider that a bad design decision.

If we had a multi-connection nnrpd, then I'd consider it a bad
design decision.

--aidan
-- 
Aidan Cully       "Umm..  Could you call back?  My house is on fire."
Panix Staff          --Tom Waits
aidan@panix.com

Re: News server architecture (was: Submitting to Freenix)
#38298
Author: Richard Michael Todd
Date: Sun, 27 Jun 1999 00:00
26 lines
2126 bytes
aidan@panix.com (Aidan Cully) writes:

> I'm pretty sure that's wrong.  I think Clayton mmap's every file in the
> overview in order to read it.  As he said, "The overview and cnfs code
> uses mmap'ing as a form of shared memory w/disk backing", and my brief
> look at the code indicates that it _really does_ rely on the shared
> memory aspect of mmap.

The portion of ov3.c that's most reliant on the use of mmap is
probably the handling of the group.index file (which contains,
basically, up-to-date group hi/lo data and the inode numbers of the
current per-group overview files.)  The remaining portions of ov3.c would
be fairly straightforward to make in both mmap() and non-mmap() versions.
You could probably get the group.index code to work non-mmap() too, replacing
each array lookup with a read() call, but I'm not sure you'd like the 
efficiency.

> > > provide. Efficiency, yes, but functionality no.  So code that *requires*
> > > mmap() is *broken*.

Arguably, yes.  But given that the overwhelming majority of systems these days 
do support mmap(), is it worth maintaining both mmap() and non-mmap() versions
of the overview code?  


Re: News server architecture (was: Submitting to Freenix)
#38299
Author: Aidan Cully
Date: Sun, 27 Jun 1999 00:00
39 lines
2503 bytes
In news.software.nntp, Russ Allbery <rra@stanford.edu> wrote:
> T William Wells <bill@twwells.com> writes:
> > Russ Allbery  <rra@stanford.edu> wrote:
> 
> >> Does now, in 2.3 CURRENT.  It would be nice to fix that, I agree, but
> >> I'm not sure if it will happen before the release.
> 
> > In which case, I'll be staying with 2.2. I have never trusted mmap()
> > and, in any case, I've yet to be convinced that FreeBSD's mmap will
> > work....
> 
> I believe that the only thing mmap() is currently absolutely required for
> is the sharing of the active file between all versions of nnrpd.  If
> that's true, that's easily fixable.  I need to go look at Clayton's notes
> again.

I'm pretty sure that's wrong.  I think Clayton mmap's every file in the
overview in order to read it.  As he said, "The overview and cnfs code
uses mmap'ing as a form of shared memory w/disk backing", and my brief
look at the code indicates that it _really does_ rely on the shared
memory aspect of mmap.

> > Lovely. Someone *needs* to look over code and say "You can't DO that!"
> > and this mmap() thing is exactly the sort of thing I'm referring to. I
> > can't conceive of any reason to *require* mmap in any system, since it
> > doesn't provide any *functionality* that regular I/O calls
> > provide. Efficiency, yes, but functionality no.  So code that *requires*
> > mmap() is *broken*.

That's a bit harsh, and I can't say I agree with you..  Read "shared
memory w/disk backing" again. :-)

--aidan
-- 
Aidan Cully       "Umm..  Could you call back?  My house is on fire."
Panix Staff          --Tom Waits
aidan@panix.com

Re: News server architecture (was: Submitting to Freenix)
#38300
Author: T. William Wells
Date: Sun, 27 Jun 1999 00:00
33 lines
2508 bytes
In article <7l5p6n$1kf$1@news.panix.com>, Aidan Cully <aidan@panix.com> wrote:
: > > Lovely. Someone *needs* to look over code and say "You can't DO that!"
: > > and this mmap() thing is exactly the sort of thing I'm referring to. I
: > > can't conceive of any reason to *require* mmap in any system, since it
: > > doesn't provide any *functionality* that regular I/O calls
: > > provide. Efficiency, yes, but functionality no.  So code that *requires*
: > > mmap() is *broken*.
:
: That's a bit harsh, and I can't say I agree with you..  Read "shared
: memory w/disk backing" again. :-)

And what exactly do you think a buffer cache is? Oh, sure, there's
some extra CPU involved in copying the data around but the reality
is that the CPU time isn't the problem, the overview *data
organization* is (was?) the problem. If the latest code change
solves the overview speed problem, I will bet that it would solve
that problem without the need for mmap(), because the *essential*
change would have been a data structure change.

Sigh. I think I'm too old -- the programming school I come from
believes in portability and correctness rather than convenience
and hack-it-out-the-door. And, yes, one can have good, fast,
portable, and *timely* code; good programming more often results
in faster delivery time than not.

(And while I'm kvetching, anyone know where a quality-oriented
programmer is to be found? I need to hire one for a position down
here in Ft. Lauderdale. So far, with rare exceptions, the
programmers who've indicated an interest barely know which end of
a stack is the business end or have never *heard* of a code
review.)

Re: News server architecture (was: Submitting to Freenix)
#38302
Author: T. William Wells
Date: Mon, 28 Jun 1999 00:00
11 lines
1281 bytes
In article <yl7looekjh.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
: There aren't a sufficient number of people working on INN at present that
: we really have the luxury of turning down code and making people rewrite
: it until it fits our requirements.

I suspect that you'd "win" if you did -- substandard but quickly
produced code doesn't generally save time, it just displaces the
time cost later in the development cycle.

Re: News server architecture (was: Submitting to Freenix)
#38305
Author: Russ Allbery
Date: Mon, 28 Jun 1999 00:00
38 lines
2597 bytes
T William Wells <bill@twwells.com> writes:

> And what exactly do you think a buffer cache is? Oh, sure, there's some
> extra CPU involved in copying the data around but the reality is that
> the CPU time isn't the problem, the overview *data organization* is
> (was?) the problem. If the latest code change solves the overview speed
> problem, I will bet that it would solve that problem without the need
> for mmap(), because the *essential* change would have been a data
> structure change.

Yup.  I agree with you.  I'm not saying INN should drop support for
systems without mmap(), just giving some background of why the requirement
is there at present.

> Sigh. I think I'm too old -- the programming school I come from believes
> in portability and correctness rather than convenience and
> hack-it-out-the-door. And, yes, one can have good, fast, portable, and
> *timely* code; good programming more often results in faster delivery
> time than not.

There aren't a sufficient number of people working on INN at present that
we really have the luxury of turning down code and making people rewrite
it until it fits our requirements.  We're unfortunately not egcs.  :)  And
the overview thing was a big enough problem that we needed to get *some*
fix checked in so that we could start cleaning it up.  Clayton did tons of
really good work; he just doesn't have a need to deal with systems without
a well-working mmap(), so he didn't.  Other people who are interested in
that problem can work on it.

Those of us who care about portability will go back and make sure it's
there.  I think it will be just as easy or easier to add it back in as it
would have been to write it that way in the first place; most of the work
was in designing the data structures and API, which will stay unchanged.

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

Re: News server architecture (was: Submitting to Freenix)
#38306
Author: Aidan Cully
Date: Mon, 28 Jun 1999 00:00
35 lines
2232 bytes
In news.software.nntp, Russ Allbery <rra@stanford.edu> wrote:
> Any reason why you can't do the same thing we used to do with the active
> file in nnrpd and just re-read it into memory on a periodic basis?  Or
> even take another step of advancement forward and resurrect actived?

I was ranting about "an improved actived" for a while there in
inn-workers..  I wanted to write a "reader data caching daemon", which
would do everything actived does, handle most of the readers.conf
authentication, and possibly do overview/article lookups for client
nnrpd processes, eventually turning "actived" itself into a multi-
connection reader daemon.  Ever so slowly, I get more and more code
written towards this.

> Seems like it's the same problem.  I'm all for mmap() as a solution, but
> we should probably provide a fallback.  It should be relatively clean to
> do so, if we have a simple API; you don't even have to inject code in that
> many different paths.

Agreed..  If we can avoid just a whole bunch of functions with the basic
structure
if (innconf->varname) {
    first_api();
} else {
    second_api();
}
.  innconf->extendeddbz really made INN quite a bit more annoying to
hack for quite a while.  IMHO.

--aidan
-- 
Aidan Cully       "Umm..  Could you call back?  My house is on fire."
Panix Staff          --Tom Waits
aidan@panix.com

Re: News server architecture (was: Submitting to Freenix)
#38307
Author: T. William Wells
Date: Mon, 28 Jun 1999 00:00
12 lines
1131 bytes
In article <7l7829$cvh$1@news.panix.com>, Aidan Cully <aidan@panix.com> wrote:
: Agreed..  If we can avoid just a whole bunch of functions with the basic
: structure
: if (innconf->varname) {
:     first_api();
: } else {
:     second_api();
: }

Function pointers.....

Re: News server architecture (was: Submitting to Freenix)
#38308
Author: Russ Allbery
Date: Mon, 28 Jun 1999 00:00
20 lines
1318 bytes
Aidan Cully <aidan@panix.com> writes:

> Agreed..  If we can avoid just a whole bunch of functions with the basic
> structure
> if (innconf->varname) {
>     first_api();
> } else {
>     second_api();
> }
> .  innconf->extendeddbz really made INN quite a bit more annoying to
> hack for quite a while.  IMHO.

Oh, agreed, I'm with you there.  The place to put the alternatives is not
in the API.  It's in the code *behind* the API.  The rest of INN should be
able to just use the same API and not care.

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

Re: News server architecture (was: Submitting to Freenix)
#38319
Author: Russ Allbery
Date: Mon, 28 Jun 1999 00:00
22 lines
1272 bytes
T William Wells <bill@twwells.com> writes:
> Aidan Cully <aidan@panix.com> wrote:

>> Agreed..  If we can avoid just a whole bunch of functions with the
>> basic structure

>> if (innconf->varname) {
>>     first_api();
>> } else {
>>     second_api();
>> }

> Function pointers.....

I believe the functions took different arguments, which was why we had all
that ugliness before.  The API didn't cleanly handle both interfaces.
It's a correctable mistake.

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

Re: News server architecture (was: Submitting to Freenix)
#38323
Author: T. William Wells
Date: Tue, 29 Jun 1999 00:00
7 lines
994 bytes
In article <1rzp1jyzlk.fsf@haey.ifi.uio.no>,
Kjetil Torgrim Homme  <kjetilho@haey.ifi.uio.no> wrote:
: Exactly why is mmap() the wrong interface to use?

Portability.

Re: News server architecture (was: Submitting to Freenix)
#38328
Author: Kjetil Torgrim Homme
Date: Tue, 29 Jun 1999 00:00
16 lines
1380 bytes
[T. William Wells]

>   I suspect that you'd "win" if you did -- substandard but quickly
>   produced code doesn't generally save time, it just displaces the
>   time cost later in the development cycle.

Exactly why is mmap() the wrong interface to use?

If you have an alternative interface design, perhaps you should
suggest it to the *BSD and Linux hackers.  I'm sure that if it pans
out there, IBM, Sun et al. will put it into their own Unixen.


Kjetil T.

Re: News server architecture (was: Submitting to Freenix)
#38344
Author: T. William Wells
Date: Wed, 30 Jun 1999 00:00
18 lines
1355 bytes
In article <1rwvwmklep.fsf@haey.ifi.uio.no>,
Kjetil Torgrim Homme  <kjetilho@haey.ifi.uio.no> wrote:
: [T. William Wells]
:
: >   Kjetil Torgrim Homme  <kjetilho@haey.ifi.uio.no> wrote:
: >   : Exactly why is mmap() the wrong interface to use?
: >
: >   Portability.
:
: Those who insist on using obsolete operating systems, should use
: similarily obsolete INN versions.  Or get the workaround using
: read/write (shudder) implemented themselves.

Substituting moralizing for technical argument is contemptible.

*plonk*

Re: News server architecture (was: Submitting to Freenix)
#38358
Author: Kjetil Torgrim Homme
Date: Wed, 30 Jun 1999 00:00
15 lines
1263 bytes
[T. William Wells]

>   Kjetil Torgrim Homme  <kjetilho@haey.ifi.uio.no> wrote:
>   : Exactly why is mmap() the wrong interface to use?
>   
>   Portability.

Those who insist on using obsolete operating systems, should use
similarily obsolete INN versions.  Or get the workaround using
read/write (shudder) implemented themselves.


Kjetil T.

Re: Submitting to Freenix
#38372
Author: Barrett Richardson
Date: Thu, 01 Jul 1999 00:00
38 lines
1831 bytes

On 25 Jun 1999, Joe Greco wrote:

<snip>

> 
> INN really loses while trying to read a large binary article from a peer.  
> You get this "Read TCP buffered data... do something else...  read TCP 
> buffered data... do something else" behaviour that might be OK if you have 
> a lot of innd main loop idle time, but really stinks if you are only coming 
> around the full set of select file descriptors every five or ten seconds.
> With a 16K receive buffer, it could take an entire minute to receive a
> 900K binary post.
> 
> So much for better latency.  My Diablo sucks that whole thing right down
> right away and then does a cxw notifying the parent diablo process.
> 


<snip>

Given the behaviours of the respective architetures of Diablo and INN,
is there anything to gain with having all the incoming feeds come
into Diablo, and have the Diablo feed an INN box (single feed) which 
in turn feeds your downstream peers with innfeed?

-

Barrett

> 
> ... JG
> 
> 


Re: Submitting to Freenix
#38376
Author: Joe Greco
Date: Thu, 01 Jul 1999 00:00
31 lines
2213 bytes
In news.software.nntp article <Pine.BSF.4.10.9907010011160.9017-100000@titan.aye.net>, Barrett Richardson <barrett@phoenix.aye.net> wrote:
:On 25 Jun 1999, Joe Greco wrote:
:<snip>
:> INN really loses while trying to read a large binary article from a peer.  
:> You get this "Read TCP buffered data... do something else...  read TCP 
:> buffered data... do something else" behaviour that might be OK if you have 
:> a lot of innd main loop idle time, but really stinks if you are only coming 
:> around the full set of select file descriptors every five or ten seconds.
:> With a 16K receive buffer, it could take an entire minute to receive a
:> 900K binary post.
:> 
:> So much for better latency.  My Diablo sucks that whole thing right down
:> right away and then does a cxw notifying the parent diablo process.
:
:<snip>
:
:Given the behaviours of the respective architetures of Diablo and INN,
:is there anything to gain with having all the incoming feeds come
:into Diablo, and have the Diablo feed an INN box (single feed) which 
:in turn feeds your downstream peers with innfeed?

Not in the context of this discussion, where we are talking about the
latencies added by various factors.  What you suggest will give us the
latencies of _both_ packages.  :-/

I'd like to see an innfeed-style feed utility for Diablo, and integrate
it at that level.

... JG

Re: News server architecture (was: Submitting to Freenix)
#38407
Author: Clayton O'Neill
Date: Sat, 03 Jul 1999 00:00
27 lines
2249 bytes
On 26 Jun 1999 22:30:04 -0400, T. William Wells <bill@twwells.com> wrote:
|Lovely. Someone *needs* to look over code and say "You can't DO
|that!" and this mmap() thing is exactly the sort of thing I'm
|referring to. I can't conceive of any reason to *require* mmap in
|any system, since it doesn't provide any *functionality* that
|regular I/O calls provide. Efficiency, yes, but functionality no.
|So code that *requires* mmap() is *broken*.

How is it broken?  mmap() is required by POSIX.  Linux, Freebsd, IRIX,
Solaris, Tru64, etc, all had working implementations last time I looked. 
HPUX doesn't, but to be honest, I have nothing but pity for people that have
to run stuff on HPUX.

The use of mmap() in this case happens to be considerably more efficent than
read()/write() since it reduces the number of memory copies done and the
number of syscalls.  Also, I haven't seen anyone else propose a better way
to do disk backed shared memory.

To be honest, this sounds like another one of the "But this isn't the way I
would have done it" whines that were a big part of the reason that I quit
contributing to the ISC INN development effort.  People that aren't willing
to contribute code can bitch all the want, but ultimately someone has to
implement it, and the people complaining shouldn't be surprised if it
doesn't meet their _personal_ standards of perfection.


Re: Submitting to Freenix
#38440
Author: bill davidsen
Date: Tue, 06 Jul 1999 00:00
30 lines
2160 bytes
In article <ylg13gyawh.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:

| Oh, you'll definitely get throughput improvements with multiple processes.
| I just don't find that problem particularly interesting, since in my
| experience INN without overview has more than enough throughput to spare,
| and with overview writing overview becomes the overwhelming problem and
| nothing else is worth optimizing.

Looks like 2.3 is giant leap in the wrong direction, then, at least as a
transit solution, since I don't see an obvious way to off the overview
generation. The 2.3 is about hald as fast accepting articles as 2.2 or a
single processor, and by moving the overview into innd it is even worse
on SMP.

I like the idea of having overview keep up with articles, but slow down
the incoming article rate doesn't seem the way to do it...

I will pull another snapshot and try that in a week or so, obviously
this is development code, but after all the work done to move various
things out of the single threaded process, I'm dubious that this is the
best way.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  The Internet is not the fountain of youth, but some days it feels like
the fountain of immaturity.


Re: Submitting to Freenix
#38441
Author: bill davidsen
Date: Tue, 06 Jul 1999 00:00
27 lines
2006 bytes
In article <7l13lo$26kv$1@twwells.com>,
T. William Wells <bill@twwells.com> wrote:
| In article <19990625104626.501$xm@newsreader.com>,
| Curt Welch <curt@kcwc.com> wrote:
| : You can't split the history DB into a separate process from the one which
| : receives articles and manages the active file info because the latency of
| : the IPC would kill your ability to receive articles quickly (at least with
| : my TCP/IP based IPC solution).
| 
| UDP would be more efficient.

You are correct, but then there would have to be code added to do flow
control, packet sequencing, and error detection and recovery. My gut
feel is that the o/s can do these things pretty well, and putting them
in an app is a lot of work and invites portability problems unless you
are very careful.

I think the time to working solution is much lower with TCP, and
overhead is likely to fixed cpu and bandwidth, as opposed to the current
INN select loop.
-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  The Internet is not the fountain of youth, but some days it feels like
the fountain of immaturity.


Re: Submitting to Freenix
#38447
Author: bill davidsen
Date: Tue, 06 Jul 1999 00:00
34 lines
2382 bytes
In article <7l127f$24lt$1@twwells.com>,
T. William Wells <bill@twwells.com> wrote:

| A context switch does not involve serious overhead. It's just a
| matter of entering the kernel, fiddling a few registers and
| loading others, and leaving the kernel. That's CPU time but
| measured in microseconds; it's just not terribly significant
| compared to other delays. Admittedly, a good thread context switch
| is faster, since it can skip the kernel entry/exit, but the
| difference just isn't meaningful compared to other slowdowns in
| the process.

I'm not sure what you mean by "a good thread context switch" here, there
are two kinds of threads, user level and kernel level. The kernel does
have a minimal kernel overhead, while all the user level libraries I've
seen are blindingly fast using a total on one processor. The kernel has
to know if you want SMP.

I've seen some discussion of mixed modes, multiple kernel threads each
running a bunch of user level threads, and I believe that Diablo mixes
multiple processes (not threads) with some form of select loop (also not
threads). I haven't looked at Diablo in months, so I may be making this
up.

If you have a bunch of sockets open you will still get worse performance
than kernel level threads, even with only one processor. Big selects are
expensive.
-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  The Internet is not the fountain of youth, but some days it feels like
the fountain of immaturity.


Re: Submitting to Freenix
#38448
Author: bill davidsen
Date: Tue, 06 Jul 1999 00:00
62 lines
3936 bytes
In article <9303290311991906734-1@dp-news.maxwell.syr.edu>,
Chris Sedore <cmsedore@maxwell.syr.edu> wrote:

| Threads are not the only possibility:  async IO can provide an alternative
| design methodology.

But it doesn't scale. I can add more processors a lot more easily than I
can make the current processor N times faster, and I get fewer context
switches because at least some of the time I don't have to preempt one
cpu from a task to do another.


| I've seen peaks of 360 incoming articles/second, and it is just loafing at
| 50-70 articles per second..  This machine is a 512MB PII-400, so it isn't
| puny hardware.  Just one disk (system and spool) and a single full-duplex
| 100Mbit link.

I'm certainly interested, assuming that this process generates enough
tracks. one of the problems I face is that non-INN solutions don't
always leave a good audit trail. INN babbles enough to add measurable
overhead, but I can always tell if and when I got a message-id, if
someone else offered it to me later, and to which queues it was added.

This saves more time placating management than debugging, but it's
useful for both.

| As Joe correclty pointed out (in a part trimmed), you have to be careful wrt
| threads packages.  FreeBSD's threads are userland wrappers around select(),
| etc and they really won't do anything significant to improve the situation.
| I believe Linux is in this boat also.  (Both offer kernel threads, but the
| implementations are a bit immature and suffer from other problems).

You could probably find a user level threads for Linux, but it isn't in
any of the regular libraries which use the kernel threads. I don't know
about maturity, all the posix threads apps I have work as I got them.

| One other area worth noting is select().  Select becomes considerably less
| efficient as more connections are added to check.  For the aio routines
| (which are not as efficient as I hope they will eventually be), there is a
| crossover at about 40 descriptors where it becomes faster to use aio
| routines over select.  The crossover is FreeBSD specific, but I suspect it
| holds true for any OS that implements select() by running through the
| descriptor table and setting a flag for each.

The whole select() thing is a can of worms, in many cases the call
returns multiple sockets ready and the application has to take steps to
do scheduling and avoid poor response to some sockets. Threads would
help this a good bit if properly done. I actually think that many of the
systems do kernel threads well, so this may be a non-issue.

I played with splitting innd with fork() for certain operations, and the
overhead was well worth it using SMP. The reliability and portability
were what you expect in a proof of concept, but I did see enough to
suggest that gains can be made.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  The Internet is not the fountain of youth, but some days it feels like
the fountain of immaturity.


Re: Asychronous I/O (was: Submitting to Freenix)
#38462
Author: bill davidsen
Date: Tue, 06 Jul 1999 00:00
21 lines
1876 bytes
In article <9303902322053107203-1@dp-news.maxwell.syr.edu>,
Chris Sedore <cmsedore@maxwell.syr.edu> wrote:

| Anyway, I probably have all of 30 hours into this little project, so its not
| too hard to experiment (well that's not to fair since I borrowed a few
| pieces from NNTPRelay and Tortoise).  I expect to turn this into open source
| in the not very distant future as it is not very likely that I am going to
| have time to dot all the i's and cross all the t's.  Its a shame to waste
| not-bad code that might be otherwise useful, if only as an example.

If this gets some attention I hope you will have the time to coordinate
things, at least for a bit. This may be why Linux is moving faster than
BSD at the moment, there is someone to make final decisions.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  The Internet is not the fountain of youth, but some days it feels like
the fountain of immaturity.


Re: Submitting to Freenix
#38478
Author: Russ Allbery
Date: Wed, 07 Jul 1999 00:00
30 lines
1775 bytes
bill davidsen <davidsen@tmr.com> writes:

> Looks like 2.3 is giant leap in the wrong direction, then, at least as a
> transit solution, since I don't see an obvious way to off the overview
> generation.

enableoverview: false in inn.conf.  Yes, I know it's not documented.  I'm
going to fix that, promise, just as soon as I get free time back again.
(Major work deadline in less than a week, and an all-day meeting
tomorrow.)

> The 2.3 is about hald as fast accepting articles as 2.2 or a single
> processor, and by moving the overview into innd it is even worse on SMP.

Yup.

> I like the idea of having overview keep up with articles, but slow down
> the incoming article rate doesn't seem the way to do it...

Well, yes and no.  If overview just isn't keeping up any other way, there
aren't exactly any alternatives.  You have to write overview as fast as
everything else.

But for SMP machines, it would really be nice to spread out the disk waits
across several processors.

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

Re: News server architecture (was: Submitting to Freenix)
#38484
Author: bill davidsen
Date: Wed, 07 Jul 1999 00:00
39 lines
2663 bytes
In article <7l5t2o$2f4m$1@twwells.com>,
T. William Wells <bill@twwells.com> wrote:

| Sigh. I think I'm too old -- the programming school I come from
| believes in portability and correctness rather than convenience
| and hack-it-out-the-door. And, yes, one can have good, fast,
| portable, and *timely* code; good programming more often results
| in faster delivery time than not.

I started programming before software engineering was invented, and I
agree that it always helps to have a nice spec, if only to know when
you're done;-) Module interface specs, etc.

That said, a proof of concept can have minimal design and next to zero
doc. I've learned to always design in at least one major flaw, however,
because management will always say "it works, we're not going to fund a
redesign and rewrite" unless there's some major thing broken (or one of
the good guys is running the project).

| (And while I'm kvetching, anyone know where a quality-oriented
| programmer is to be found? I need to hire one for a position down
| here in Ft. Lauderdale. So far, with rare exceptions, the
| programmers who've indicated an interest barely know which end of
| a stack is the business end or have never *heard* of a code
| review.)

We're all looking for something... I'm looking for that great chance to
really work from home, never go to an office, set my own hours and only
work 50 hours a week or so, and let someone else be management. I
suspect you're more likely to find a programmer than I am to find a 100%
telecommuting job;-)

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  The Internet is not the fountain of youth, but some days it feels like
the fountain of immaturity.


Re: News server architecture (was: Submitting to Freenix)
#38488
Author: bill davidsen
Date: Wed, 07 Jul 1999 00:00
18 lines
1642 bytes
In article <ylaetljfxu.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:

| Any reason why you can't do the same thing we used to do with the active
| file in nnrpd and just re-read it into memory on a periodic basis?  Or
| even take another step of advancement forward and resurrect actived?

I think overviewd is probably the way to go. unlike history lookups, the
overview lookups are relatively infrequent, and many reader would
happily trade a little slower start for getting the info overall faster.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  The Internet is not the fountain of youth, but some days it feels like
the fountain of immaturity.


Re: Submitting to Freenix
#38507
Author: bill davidsen
Date: Thu, 08 Jul 1999 00:00
46 lines
2692 bytes
In article <ylr9mko4q2.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
| bill davidsen <davidsen@tmr.com> writes:
| 
| > Looks like 2.3 is giant leap in the wrong direction, then, at least as a
| > transit solution, since I don't see an obvious way to off the overview
| > generation.
| 
| enableoverview: false in inn.conf.  Yes, I know it's not documented.  I'm
| going to fix that, promise, just as soon as I get free time back again.
| (Major work deadline in less than a week, and an all-day meeting
| tomorrow.)

My fault on that, the name is explanitory enough, but I've been using
this on reader machines, so I haven't done the looking I should have
before posting.

| > The 2.3 is about half as fast accepting articles as 2.2 or a single
| > processor, and by moving the overview into innd it is even worse on SMP.
| 
| Yup.

Unfortunately if news won't go into the machine as fast as it comes off
the net, I don't care about readers :-(

| > I like the idea of having overview keep up with articles, but slow down
| > the incoming article rate doesn't seem the way to do it...
| 
| Well, yes and no.  If overview just isn't keeping up any other way, there
| aren't exactly any alternatives.  You have to write overview as fast as
| everything else.
| 
| But for SMP machines, it would really be nice to spread out the disk waits
| across several processors.

Is it a disk issue or a cpu issue? On a single cpu machine the separate
overchan is not getting a cpu of its own, so that's not why it's faster.
Something in 2.3 is dog slow relative to 2.2.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  The Internet is not the fountain of youth, but some days it feels like
the fountain of immaturity.


Re: Submitting to Freenix
#38525
Author: Russ Allbery
Date: Thu, 08 Jul 1999 00:00
19 lines
1338 bytes
bill davidsen <davidsen@tmr.com> writes:

> Is it a disk issue or a cpu issue? On a single cpu machine the separate
> overchan is not getting a cpu of its own, so that's not why it's faster.
> Something in 2.3 is dog slow relative to 2.2.

Yes, writing overview.

Either you make overview dog-slow for readers by making it fast to write,
or you make it nice and fast for readers by spending more time writing it.
No one's yet found a third alternative for INN.

I really doubt the overview code in INN 2.3 is noticeably slower than
overchan.

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

Re: Submitting to Freenix
#38555
Author: bill davidsen
Date: Fri, 09 Jul 1999 00:00
51 lines
3191 bytes
In article <yl673uqpv3.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
| bill davidsen <davidsen@tmr.com> writes:
| 
| > Is it a disk issue or a cpu issue? On a single cpu machine the separate
| > overchan is not getting a cpu of its own, so that's not why it's faster.
| > Something in 2.3 is dog slow relative to 2.2.
| 
| Yes, writing overview.
| 
| Either you make overview dog-slow for readers by making it fast to write,
| or you make it nice and fast for readers by spending more time writing it.
| No one's yet found a third alternative for INN.
| 
| I really doubt the overview code in INN 2.3 is noticeably slower than
| overchan.

Perhaps it's because I'm running xferslave? But I can't see why this
would make any significant difference looking at the code. The old 1.x
was slower because it couldn't use streaming feeds, but that's not an
issue here.

2.3 is inherently slower, I think, because now all of innd grinds to a
halt for every disk i/o. Instead of doing article accept and overview
write in separate processes which can each block. The new code has
essentially put all the disk i/o "in series" so that when any i/o takes
place the whole process grinds to a halt.

In addition, you have two files per group instead of one, more opens and
more writes. This is another move in the wrong direction.

This is not an insoluble problem, the saito patches to 2.1 ran like the
clappers of hell for both accept and read. I regard them as a proof of
concept rather than a solution because they didn't work well (for me)
with xrefslave, and because recreating overview didn't seem to work
properly. The first was a minor code fix, since it worked for about 90%
of the articles, and the second was due to putting the overview in the
same cycbuffs as the articles, instead of their own cycbuffs.

If you are right about the tradeoff between incoming and outgoing
overview speed. If reader overview is slow it annoys the readers. If the
machine can't accept news as fast as the net generates it there is no
current news for the readers at all.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  The Internet is not the fountain of youth, but some days it feels like
the fountain of immaturity.


Re: Submitting to Freenix
#38559
Author: Russ Allbery
Date: Fri, 09 Jul 1999 00:00
21 lines
1405 bytes
Katsuhiro Kondou <kondou@uxd.fc.nec.co.jp> writes:
> Russ Allbery <rra@stanford.edu> wrote;

>> I really doubt the overview code in INN 2.3 is noticeably slower than
>> overchan.

> Overview code in CURRENT needs open two files;index and data.
> As for 2.2, it opens one file;index.

Hm, yeah, that's a good point.

> New code I'm writing will not open and close for each group, and believe
> it makes faster to receive articles.

I can easily believe that; retrieving articles is what I'll be interested
to see.  But good luck!

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

Re: Submitting to Freenix
#38573
Author: Richard Michael Todd
Date: Fri, 09 Jul 1999 00:00
16 lines
1847 bytes
Russ Allbery <rra@stanford.edu> writes:
> I really doubt the overview code in INN 2.3 is noticeably slower than
> overchan.

I doubt it is either, but I think it causes an overall degradation in 
performance because innd is now spending time blocked waiting for the 
syscalls to complete, whereas before overchan would block and innd could still
keep going.   I'm seriously tempted to hack the code to make it possible to
have a separate overchan process again (as an option).  Shouldn't be that 
difficult, as all overchan would have to do is read lines from stdin and call
OV3add() on them.  Of course, that does bring back the issue of innd getting
ahead of overchan, but some clever innwatch.ctl trickery can keep that from
being too much of a problem by pausing innd if the backlog on the 
'overview!' channel gets too large and unpausing it otherwise.  

Re: Submitting to Freenix
#38575
Author: Chris Sedore
Date: Sat, 10 Jul 1999 00:00
111 lines
5857 bytes
bill davidsen wrote in message
<7lu3k8$2m0a$1@newssvr03-int.news.prodigy.com>...
>In article <9303290311991906734-1@dp-news.maxwell.syr.edu>,
>Chris Sedore <cmsedore@maxwell.syr.edu> wrote:
>
>| Threads are not the only possibility:  async IO can provide an
alternative
>| design methodology.
>
>But it doesn't scale. I can add more processors a lot more easily than I
>can make the current processor N times faster, and I get fewer context
>switches because at least some of the time I don't have to preempt one
>cpu from a task to do another.


Well, that depends on a couple factors.  At 2 processors, aio can function
nicely by essentially putting the process on one and the kernel on the
other--in my experience, the "kernel processor" will be the bottleneck here,
so scalability gets questionable somewhere between 2 and 3 processors
(assuming that your kernel can run on more than one processor--if it can't,
you'll probably run out of capacity to run the kernel before running out of
userland time in a single thread).  With well written aio code and good
kernel threads, you simply run a thread per processor to get around the
scalability problem.  Carefully designed aio code can be converted to
multithreaded aio code without too much difficulty.  That said, there still
is a penalty to going threaded because you've got to mutex some things, so
it isn't a complete win.

>| I've seen peaks of 360 incoming articles/second, and it is just loafing
at
>| 50-70 articles per second..  This machine is a 512MB PII-400, so it isn't
>| puny hardware.  Just one disk (system and spool) and a single full-duplex
>| 100Mbit link.
>
>I'm certainly interested, assuming that this process generates enough
>tracks. one of the problems I face is that non-INN solutions don't
>always leave a good audit trail. INN babbles enough to add measurable
>overhead, but I can always tell if and when I got a message-id, if
>someone else offered it to me later, and to which queues it was added.
>
>This saves more time placating management than debugging, but it's
>useful for both.


This isn't too difficult to address, though some of us would want it to be
setable.  I don't pay quite that level of attention to news flows, and would
be happy not to pay the CPU and IO price for that level of detail.

>| As Joe correclty pointed out (in a part trimmed), you have to be careful
wrt
>| threads packages.  FreeBSD's threads are userland wrappers around
select(),
>| etc and they really won't do anything significant to improve the
situation.
>| I believe Linux is in this boat also.  (Both offer kernel threads, but
the
>| implementations are a bit immature and suffer from other problems).
>
>You could probably find a user level threads for Linux, but it isn't in
>any of the regular libraries which use the kernel threads. I don't know
>about maturity, all the posix threads apps I have work as I got them.


Well last I looked at Linux kernel threads (about 6-8 months ago), they were
the ugly stepchildren.  I (ahem) keep waiting for Unix to catch up with NT
on this front.  I know that FreeBSD (and think that Linux) threads are
actually just processes that share vm and fds.  This is somewhat less
efficient that true threads.  I'll have to look again at Linux.

>| One other area worth noting is select().  Select becomes considerably
less
>| efficient as more connections are added to check.  For the aio routines
>| (which are not as efficient as I hope they will eventually be), there is
a
>| crossover at about 40 descriptors where it becomes faster to use aio
>| routines over select.  The crossover is FreeBSD specific, but I suspect
it
>| holds true for any OS that implements select() by running through the
>| descriptor table and setting a flag for each.
>
>The whole select() thing is a can of worms, in many cases the call
>returns multiple sockets ready and the application has to take steps to
>do scheduling and avoid poor response to some sockets. Threads would
>help this a good bit if properly done. I actually think that many of the
>systems do kernel threads well, so this may be a non-issue.


This is actually a good thing from an efficiency standpoint.
Response/scheduling problems are probably more a result of blocking calls in
the processing loop that happens after a socket has been flagged than
because of select().  You have to have quite a number of descriptors to
select() with a non-blocking loop before I would expect scheduling to be a
major problem (like 300-400).

>I played with splitting innd with fork() for certain operations, and the
>overhead was well worth it using SMP. The reliability and portability
>were what you expect in a proof of concept, but I did see enough to
>suggest that gains can be made.


I've thought about modifying innd so that just the article writes were done
with aio.  This might be doable and should resolve the scheduling problem,
modulo this new overview scheme which would require a fair bit more work for
the same result.

-Chris



Re: Submitting to Freenix
#38585
Author: Clayton O'Neill
Date: Sat, 10 Jul 1999 00:00
27 lines
2196 bytes
On 9 Jul 1999 19:10:22 GMT, bill davidsen <davidsen@tmr.com> wrote:
|Perhaps it's because I'm running xferslave? But I can't see why this
|would make any significant difference looking at the code. The old 1.x
|was slower because it couldn't use streaming feeds, but that's not an
|issue here.
|
|2.3 is inherently slower, I think, because now all of innd grinds to a
|halt for every disk i/o. Instead of doing article accept and overview
|write in separate processes which can each block. The new code has
|essentially put all the disk i/o "in series" so that when any i/o takes
|place the whole process grinds to a halt.

Yeap, you're right.  It's about 1-2 hours of work to write a new overchan to
function the way the old one did and add a switch to inn (or put back into
use the old one), to allow innd to farm that work out.

|If you are right about the tradeoff between incoming and outgoing
|overview speed. If reader overview is slow it annoys the readers. If the
|machine can't accept news as fast as the net generates it there is no
|current news for the readers at all.

I can get about 150 art/s into my boxes with the overview write inline, so I
never bothered to rewrite overchan.  I've never pretended it was a good
decision, but it does eliminate some problems, and it doesn't cause any _for
me_.

Re: Submitting to Freenix
#38587
Author: Katsuhiro Kondou
Date: Sat, 10 Jul 1999 00:00
19 lines
1866 bytes
In article <yl673uqpv3.fsf@windlord.stanford.edu>,
	Russ Allbery <rra@stanford.edu> wrote;

} I really doubt the overview code in INN 2.3 is noticeably slower than
} overchan.

Overview code in CURRENT needs open two files;index and data.
As for 2.2, it opens one file;index.  The most overhead of
current overview code I'm thinking is to open and close those
files.  And increasing overcachesize does not help so much.
I can see many close and open those files by truss even with
setting overcachesize 480.

New code I'm writing will not open and close for each group,
and believe it makes faster to receive articles.
-- 
Katsuhiro Kondou

Re: Submitting to Freenix
#38606
Author: Chris Sedore
Date: Mon, 12 Jul 1999 00:00
37 lines
2318 bytes
Miquel van Smoorenburg wrote in message <7mdok5$el3$1@Q.cistron.nl>...
>In article <931605626-1026466000-1@dp-news.maxwell.syr.edu>,
>Chris Sedore <cmsedore@maxwell.syr.edu> wrote:
>>Well last I looked at Linux kernel threads (about 6-8 months ago), they
were
>>the ugly stepchildren.  I (ahem) keep waiting for Unix to catch up with NT
>>on this front.  I know that FreeBSD (and think that Linux) threads are
>>actually just processes that share vm and fds.  This is somewhat less
>>efficient that true threads.  I'll have to look again at Linux.
>
>Well, it seems that Linux kernel threads are lightweight enough to be
>more efficient than the NT threads or Solaris kernel/user threads,
>even though they really are actually just processes that share vm and fds.
>A context switch is frightingly efficient in Linux.


That's good to know.  There are other areas where things were painful--the
synchronization primatives were not so great (well, we are stuck with posix
threads) in terms of efficiency.  Beyond that, I'm not sure the process
model scales so well and this (I understood) was an area of weakness in
Linux.  News.maxwell.syr.edu, as an example, runs around 1000 threads in the
NNTPRelay process.  I'm not sure that having 1000 processes running,
particularly in cases where 100 or more may be awoken simultaneously, would
scale the same way as 10 or even 100.

>I don't know about FreeBSD, I think the lm_bench program is able to
>measure context switch timings, you could try that.


Thanks for the pointer.

-Chris



Re: Submitting to Freenix
#38612
Author: bill davidsen
Date: Mon, 12 Jul 1999 00:00
79 lines
4874 bytes
In article <931605626-1026466000-1@dp-news.maxwell.syr.edu>,
Chris Sedore <cmsedore@maxwell.syr.edu> wrote:
| 
| bill davidsen wrote in message
| <7lu3k8$2m0a$1@newssvr03-int.news.prodigy.com>...

| >I'm certainly interested, assuming that this process generates enough
| >tracks. one of the problems I face is that non-INN solutions don't
| >always leave a good audit trail. INN babbles enough to add measurable
| >overhead, but I can always tell if and when I got a message-id, if
| >someone else offered it to me later, and to which queues it was added.
| >
| >This saves more time placating management than debugging, but it's
| >useful for both.
| 
| This isn't too difficult to address, though some of us would want it to be
| setable.  I don't pay quite that level of attention to news flows, and would
| be happy not to pay the CPU and IO price for that level of detail.

Settable logging, by feature rather than someone's idea of levels, would
be great. I wouldn't even complain if they could be disabled at compile
time to avoid even the overhead of checking a flag. But at some
installations I really have a requirement to be able to track in and out
by message-id. On others I have no such interest. I'm not sure how much
overhead logging generates as a percentage, but I suspect the answer is
not much.

| >You could probably find a user level threads for Linux, but it isn't in
| >any of the regular libraries which use the kernel threads. I don't know
| >about maturity, all the posix threads apps I have work as I got them.
| 
| Well last I looked at Linux kernel threads (about 6-8 months ago), they were
| the ugly stepchildren.  I (ahem) keep waiting for Unix to catch up with NT
| on this front.  I know that FreeBSD (and think that Linux) threads are
| actually just processes that share vm and fds.  This is somewhat less
| efficient that true threads.  I'll have to look again at Linux.

I think you may be right, but I'm not sure this is bad. Having yet
another level of cpu dispatch may be conceptually elegant, but there
were some measurements of overhead from fork() vs. thread init, and of
context overhead with several threads sharing data with various methods
of IPC, and there was not much to choose there.

| This is actually a good thing from an efficiency standpoint.
| Response/scheduling problems are probably more a result of blocking calls in
| the processing loop that happens after a socket has been flagged than
| because of select().  You have to have quite a number of descriptors to
| select() with a non-blocking loop before I would expect scheduling to be a
| major problem (like 300-400).

Someone posted a note taken from real data which indicated that separate
processes were faster and lower overhead at a much lower number, like
12-15. I didn't save it, and it wasn't my measurement, but I don't think
select() is low overhead inherently, since it checks a lot of
descriptors and the cost goes up linearly or worse with the number of
descriptors open.

Original poster of the data please chime in if you see this.


| >I played with splitting innd with fork() for certain operations, and the
| >overhead was well worth it using SMP. The reliability and portability
| >were what you expect in a proof of concept, but I did see enough to
| >suggest that gains can be made.
| 
| I've thought about modifying innd so that just the article writes were done
| with aio.  This might be doable and should resolve the scheduling problem,
| modulo this new overview scheme which would require a fair bit more work for
| the same result.

Multiple solutions are nice, they give the next implementor a chance to
pick a different set of solutions to the news problem set.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  The Internet is not the fountain of youth, but some days it feels like
the fountain of immaturity.

Re: Submitting to Freenix
#38634
Author: Miquel van Smoorenburg
Date: Tue, 13 Jul 1999 00:00
21 lines
1794 bytes
In article <931605626-1026466000-1@dp-news.maxwell.syr.edu>,
Chris Sedore <cmsedore@maxwell.syr.edu> wrote:
>Well last I looked at Linux kernel threads (about 6-8 months ago), they were
>the ugly stepchildren.  I (ahem) keep waiting for Unix to catch up with NT
>on this front.  I know that FreeBSD (and think that Linux) threads are
>actually just processes that share vm and fds.  This is somewhat less
>efficient that true threads.  I'll have to look again at Linux.

Well, it seems that Linux kernel threads are lightweight enough to be
more efficient than the NT threads or Solaris kernel/user threads,
even though they really are actually just processes that share vm and fds.
A context switch is frightingly efficient in Linux.

I don't know about FreeBSD, I think the lm_bench program is able to
measure context switch timings, you could try that.

Mike.
-- 
Beware of Programmers who carry screwdrivers.

Re: Submitting to Freenix
#38644
Author: T. William Wells
Date: Tue, 13 Jul 1999 00:00
36 lines
2640 bytes
In article <7m5heu$3uai$1@newssvr03-int.news.prodigy.com>,
bill davidsen <davidsen@tmr.com> wrote:
: 2.3 is inherently slower, I think, because now all of innd grinds to a
: halt for every disk i/o. Instead of doing article accept and overview
: write in separate processes which can each block. The new code has
: essentially put all the disk i/o "in series" so that when any i/o takes
: place the whole process grinds to a halt.
:
: In addition, you have two files per group instead of one, more opens and
: more writes. This is another move in the wrong direction.

I cannot say that these observations surprise me.

: If you are right about the tradeoff between incoming and outgoing
: overview speed. If reader overview is slow it annoys the readers. If the
: machine can't accept news as fast as the net generates it there is no
: current news for the readers at all.

The thing that ties the two together is that the overview is the
definitive word on what articles are available, while the active
file is the definitive word on what article number ranges are
valid. Once the active file represents that an article exists, the
data _must_ be in the overview or readers will presume that the
article is not available, thus compelling the overview write to be
in innd, where it can guarantee that the overview is written
before the active file.

This is a major design defect which must be remedied in order to
eliminate the tradeoff. Two solutions come to mind. The first is
returning to the status quo ante (which also applies with the new
code, if you use the traditional storage method), in which the
spool determines the existing articles. The second is to have a
second file, similar to the active file, which is updated only
after articles are entered into the overview.

Re: Submitting to Freenix
#38647
Author: Russ Allbery
Date: Tue, 13 Jul 1999 00:00
39 lines
2786 bytes
T William Wells <bill@twwells.com> writes:

> This is a major design defect which must be remedied in order to
> eliminate the tradeoff. Two solutions come to mind. The first is
> returning to the status quo ante (which also applies with the new code,
> if you use the traditional storage method), in which the spool
> determines the existing articles. The second is to have a second file,
> similar to the active file, which is updated only after articles are
> entered into the overview.

The active file currently contains three separate facts:  The range of
articles in the group currently present on disk, the article number to
assign to the next incoming message in that group, and mode of the
newsgroup.  The first fact is used only by readers.  The second fact is
used only by transit, provided that the first fact gets updated reasonably
when new articles come in.  The third fact is used by both.

To me, this argues strongly for breaking these things into three separate
files.  The range of available articles should be written by the same
thing that writes out the overview information, which can be offloaded
outside innd.  The second file, the next number information, is entirely
internal to innd, since Xref in the articles provides the only information
anything else need care about, so innd should maintain it internally and
just checkpoint it periodically.  The third file would need to be
assembled with the second file internally by nnrpd to answer active file
queries from the client, but it also could contain the mapping of
newsgroup to number needed by the tradspool storage method and usable by
other parts of INN (such as the new overview mechanism, which needs a hash
of the group; a number would be ideal).

That's a pretty serious architecture change, but it might be worthwhile.
One of the problems would be keeping those three files in sync.  The third
file, if it contains tradspool mapping info, also needs to retain deleted
groups for some time.

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

Page 2 of 2 • 90 total messages
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads