🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
55 messages
55 total messages Page 1 of 2 Started by Jon Mansey Sat, 02 Oct 1999 00:00
Page 1 of 2 • 55 total messages
INN maxed? Time to add a Diablo router?
#40374
Author: Jon Mansey
Date: Sat, 02 Oct 1999 00:00
38 lines
1915 bytes
Hi,

I am wondering if my INN box isnt maxed out doing readers and feeds. Im
seeing dropped articles regularly these days, in particular incomplete
binary posts. 

Go ahead, call me crazy for trying to take all the binaries, but I like
the challenge of running FULL news. My readers appreciate it also.

Some specs, FreeBSD3.2, PII450/512M/180G SCSI RAID, INN2.2, cleanfeed,
multiple DS3s. We have around 25 peers and we see nominally around 80 innd
connections and 60 innfeed connections, around 50GB per day. We're at
around the 500s on FreeNix, whatever that means these days. 5min CPU load
hovers around 1.0

We only have around 50 readers but several of those are DNEWS boxes that
take up to 10K articles per day.

Im thinking of adding a Diablo router to handle the feeds and just
dedicate the INN box for spool and readers. 

A couple of questions:

a) Is this a sensible/logical upgrade for handling news growth?

b) Will it fix the dropped binary parts problem?

c) will it make my readers happier, eg faster response?

d) what is your experience of INN's limits in these areas?

e) will it make me irresistable to women?

Any suggestions or experiences shared would be much appreciated. 

Jon.

Re: INN maxed? Time to add a Diablo router?
#40380
Author: Russ Allbery
Date: Sat, 02 Oct 1999 00:00
107 lines
6816 bytes
Jon Mansey <foo@blah.com> writes:

> INND timer:
> Code region                 Time    Pct    Invoked  Min(ms)  Avg(ms)  Max(ms)
> article cancel      00:40:43.475   2.8%      64142   10.264   38.095   95.060
> article control     00:39:58.340   2.8%      62750   10.291   38.221   96.357
> article link        00:00:02.422   0.0%     196791    0.000    0.012    0.039
> article write       09:30:23.838  39.7%     748448   29.396   45.726   72.454
> history grep        00:04:41.712   0.3%      37983    0.000    7.417   17.075
> history lookup      01:08:42.681   4.8%   13672409    0.104    0.302    1.850
> history sync        00:00:28.536   0.0%      93569    0.046    0.305    3.489
> history write       03:08:59.200  13.2%     933987    7.011   12.141   17.878
> idle                01:49:34.946   7.6%    8045117    0.116    0.817    2.118
> perl filter         04:37:14.726  19.3%     906176    9.777   18.357   34.797
> site send           00:22:03.499   1.5%    2245344    0.305    0.589    1.220

> TOTAL: 23:56:58     22:02:53.375  92.1%          -        -        -        -

> How do I interpret this? I see it spends most of the time writing, but
> that would be normal, no?

Yes and no.  It's normal, but the time is high.  For comparison, here are
the statistics for nntp.stanford.edu, my reader system (INN 1.7.2).

INND timer :
Code region                            Time    Pct    Invoked       Each
idle                           18:07:32.297  75.7%    8132785      8.023
article write                  03:48:53.861  15.9%     255830     53.684
article control                00:07:02.085   0.5%      20650     20.440
article cancel                 00:00:42.520   0.0%       1130     37.628
crosslink                      00:00:00.772   0.0%      34144      0.023
site send                      00:03:45.067   0.3%     494247      0.455
history write                  00:01:31.144   0.1%     266795      0.342
history sync                   00:00:12.346   0.0%      51248      0.241
history lookup                 00:37:06.038   2.6%     269527      8.259
history grep                   00:00:52.619   0.1%      10441      5.040

Here are the statistics for newsfeed.stanford.edu, my primary feed
machine, running INN 2.2.1 (roughly):

INND timer:
Code region                   Time    Pct    Invoked  Min(ms)  Avg(ms)  Max(ms)
article cancel        00:01:28.393   0.1%      21492    0.204    4.113   17.278
article control       00:01:22.948   0.1%      20727    0.208    4.002   16.966
article link          00:00:00.000   0.0%          0    0.000    0.000    0.000
article write         00:12:32.090   0.9%     256299    0.762    2.934    9.001
history grep          00:00:18.188   0.0%      15686    0.019    1.160    6.651
history lookup        00:22:50.941   1.6%    7643865    0.005    0.179    1.281
history sync          00:00:08.292   0.0%      78281    0.066    0.106    0.316
history write         00:20:34.648   1.4%     781144    0.189    1.581    7.762
idle                  19:33:22.395  81.5%   23857884    1.945    2.951    4.957
perl filter           00:39:30.217   2.7%     773005    1.879    3.066    6.690
site send             00:11:55.754   0.8%     488190    1.110    1.466    2.369

TOTAL: 24:00:01.491   21:24:03.866  89.2%          -        -        -        -

There are a few things to notice from this.

First, I'm taking about a third the number of articles as you are, which
is about what I'd expect given that you're trying to take a completely
full feed.  If nntp were taking three times as many articles as it is, it
would be pushing the performance bottlenecks too.  However, note that even
if newsfeed were taking three times as many articles as it's taking now,
it wouldn't even be breathing hard.

There are a few reasons for that.  The primary one is that nntp is using
traditional spool, whereas newsfeed is using CNFS.  CNFS is *way* faster
for writing.  Judging from your article write times, I'd be very surprised
if you're using CNFS.

Given that you're using 2.2.1, the difficulty with CNFS is that unified
overview performance is rather slow.  However, with your reader load, that
may not actually be a problem.  I don't know if DNEWS readers even care
about overview, for example; I can think of several different ways of
implementing a suck model of feed, several of which wouldn't use overview
at all.  CNFS would be an immediate performance win for you.

The real long term solution for your difficulties if you didn't want to
take the full plunge to CNFS, were you to stay with INN (and note that I'm
not necessarily advocating that -- I've only ever used INN, so I'm not the
person to ask for comparisons between servers), would be to switch to a
mixed storage model, which is possible under the current unstable
development version of INN (which is what we all call INN 2.3).  INN 2.3
also has a much faster overview system.  Of course, the drawback is that
it's unstable development code and is currently somewhat underdocumented
(although Kondou's done a bunch of work to try to fix that).

Under INN 2.3, if you wanted to keep traditional spool for non-binary
newsgroups, you could still put all the binary newsgroups in CNFS.  I
think that at this point you really don't ever want to put binary groups
in anything other than CNFS or the like; they're just too slow to write
otherwise and you run too much of a danger of running out of disk space.

The other thing that you can look at is your I/O subsystem and see about
increasing its speed.  The other reason why newsfeed is so much faster is
because it has a *much* faster I/O subsystem than my current reader
machine, including a very large write-back disk cache.  Write-back cache,
in my experience, helps dramatically in lowering write times for a news
server.  But that's somewhat harder to fix and potentially more expensive.

I would expect Diablo to be faster for you since (although I haven't used
Diablo) I think it's doing something CNFS-like for article storage.

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

Re: INN maxed? Time to add a Diablo router?
#40384
Author: Jon Mansey
Date: Sat, 02 Oct 1999 00:00
35 lines
2468 bytes
In article <yl3dvtp0xb.fsf@windlord.stanford.edu>, Russ Allbery
<rra@stanford.edu> wrote:

> Jon Mansey <foo@blah.com> writes:
> 
> > I am wondering if my INN box isnt maxed out doing readers and feeds. Im
> > seeing dropped articles regularly these days, in particular incomplete
> > binary posts.
> 
> So what is your INN timer information saying about the server and where
> the bottlenecks are?  That's valuable information not only for tuning INN
> but for determining whether a change of servers will help.

INND timer:
Code region                   Time    Pct    Invoked  Min(ms)  Avg(ms)  Max(ms)
article cancel        00:40:43.475   2.8%      64142   10.264   38.095   95.060
article control       00:39:58.340   2.8%      62750   10.291   38.221   96.357
article link          00:00:02.422   0.0%     196791    0.000    0.012    0.039
article write         09:30:23.838  39.7%     748448   29.396   45.726   72.454
history grep          00:04:41.712   0.3%      37983    0.000    7.417   17.075
history lookup        01:08:42.681   4.8%   13672409    0.104    0.302    1.850
history sync          00:00:28.536   0.0%      93569    0.046    0.305    3.489
history write         03:08:59.200  13.2%     933987    7.011   12.141   17.878
idle                  01:49:34.946   7.6%    8045117    0.116    0.817    2.118
perl filter           04:37:14.726  19.3%     906176    9.777   18.357   34.797
site send             00:22:03.499   1.5%    2245344    0.305    0.589    1.220

TOTAL: 23:56:58.452   22:02:53.375  92.1%          -        -        -        -

How do I interpret this? I see it spends most of the time writing, but
that would be normal, no?

jm

Re: INN maxed? Time to add a Diablo router?
#40389
Author: Russ Allbery
Date: Sat, 02 Oct 1999 00:00
14 lines
1044 bytes
Jon Mansey <foo@blah.com> writes:

> I am wondering if my INN box isnt maxed out doing readers and feeds. Im
> seeing dropped articles regularly these days, in particular incomplete
> binary posts.

So what is your INN timer information saying about the server and where
the bottlenecks are?  That's valuable information not only for tuning INN
but for determining whether a change of servers will help.

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

Re: INN maxed? Time to add a Diablo router?
#40399
Author: Brad Knowles
Date: Sun, 03 Oct 1999 00:00
74 lines
4354 bytes
In article <foo-0210991412200001@192.168.2.3>, foo@blah.com (Jon Mansey) wrote:

> Im thinking of adding a Diablo router to handle the feeds and just
> dedicate the INN box for spool and readers. 

    While I'm a big fan of Diablo, I don't think it's strictly necessary
in this environment.  Much more important would be to split the functions
between the news spool/reader server and the news transit server.  If you
prefer, you could continue to run INN on both boxes.  Or, if you like, you
could take this as an opportunity to start to learn Diablo.  However, I do
not believe that Diablo is a critical part of this picture.

> a) Is this a sensible/logical upgrade for handling news growth?

    Splitting the functions is logical, yes.

> b) Will it fix the dropped binary parts problem?

    Probably.  By letting each machine be better tuned to perform a part
of the overall job, they should be better at the parts that they will be
doing.

> c) will it make my readers happier, eg faster response?

    Probably.  The reader/spool system places a heavy load on a system, as
does the news transit service.  But they're heavy in different ways, and
splitting those functions is likely to make the split machine much faster
at their respective parts of the job.

> d) what is your experience of INN's limits in these areas?

    IMO, INN is faster than Diablo.  However, I believe that Diablo is
easier to manage, and handles certain types of tasks better than INN
(although you don't seem to need those sorts of things at the moment). 
You've got to ask yourself whether it's worth spending a fair amount of
time coming up to speed on a new piece of software.


    Diablo is great at building a distributed, reliable news server system
(where multiple components could fail and the overall system would remain
operational), and it's particularly good at having multiple news transit
servers at a site appear externally to be one large "news transit service"
for the whole site.

    For example, if you were Uunet, and you had hundreds of news servers
all around the world, each of them could exchange news with each other on
a private port, using just a "hostname!" path element.  However, in all
their communications with external sites, they could use a
"hostname!Uunet!" path element on the standard port 119, and your peers
would be able to alias on both your hostname and the shared "Uunet" tag in
order to help make sure they didn't feed any articles to you that you had
already seen.  This would also allow you to have that single lable of
"Uunet" show up on the Freenix list at a level that would be much higher
than the rating that any one of your machines would be likely to achieve.

    That's just one example of where I think Diablo does a better job than
INN.  There are others.  In addition, there are areas where I think INN is
better than Diablo, primarily in terms of how fast INN handles an article
(although those are features I hope to help be able to correct in Diablo,
so maybe INN won't have those advantages for too much longer ;-).

> e) will it make me irresistable to women?

    If you're asking that question on this newsgroup, you should know by
now that you're already lost.  ;-)

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>

Are you a USENET news server administrator outside of North America or
Western Europe?  Would you like a newsfeed from a site in the Freenix
Top 100?  If so, please contact me via private e-mail for details.

Re: INN maxed? Time to add a Diablo router?
#40401
Author: Katsuhiro Kondou
Date: Sun, 03 Oct 1999 00:00
13 lines
1463 bytes
In article <foo-0210992103530001@192.168.2.3>,
	foo@blah.com (Jon Mansey) wrote;

} How do I interpret this? I see it spends most of the time writing, but
} that would be normal, no?

I suspect you're running traditional.  You will get
enough feed performance, if you run cnfs.  And you'll
get enough reader performance, if you run 2.3.
-- 
Katsuhiro Kondou

Re: INN maxed? Time to add a Diablo router?
#40403
Author: Joe Greco
Date: Sun, 03 Oct 1999 00:00
25 lines
1769 bytes
In news.software.nntp article <7t8gr6$7tm$1@xs4.xs4all.nl>, sico@xs4.xs4all.nl (Sico Bruins) wrote:
:In article <slrn7veimb.irn.niels@liquid.tpb.net>,
:N <niels@usenet.bakker.net> wrote:
:
:>In article <brad-0310991300490001@dialup995.brussels2.skynet.be>,
:>	Brad Knowles wrote:
:>
:>>> Here are the statistics for newsfeed.stanford.edu, my primary feed
:>>> machine, running INN 2.2.1 (roughly):
:>>     Man, how do you guys get these statistics?!?
:>
:>By enabling it in inn.conf.  The switch to toggle is `timer' -- make it
:>non-zero, 300 is a good value.
:
:Brad runs Diablo and is jealous of us inn users because of this cool
:timer feature. ;-)

Quiet, or I'm going to have to hurt you.  Those of us who run Diablo
typically don't _need_ those sorts of stats.  (Don't forget, I wrote
the damn thing, it was one of my very compelling reasons to go to
Diablo).

... JG

Re: INN maxed? Time to add a Diablo router?
#40407
Author: Sico Bruins
Date: Sun, 03 Oct 1999 00:00
21 lines
1464 bytes
In article <slrn7veimb.irn.niels@liquid.tpb.net>,
N <niels@usenet.bakker.net> wrote:

>In article <brad-0310991300490001@dialup995.brussels2.skynet.be>,
>	Brad Knowles wrote:
>
>>> Here are the statistics for newsfeed.stanford.edu, my primary feed
>>> machine, running INN 2.2.1 (roughly):
>>     Man, how do you guys get these statistics?!?
>
>By enabling it in inn.conf.  The switch to toggle is `timer' -- make it
>non-zero, 300 is a good value.

Brad runs Diablo and is jealous of us inn users because of this cool
timer feature. ;-)

>	-- Niels.

CU, Sico (http://people.a2000.nl/sico/).

Re: INN maxed? Time to add a Diablo router?
#40409
Author: Russ Allbery
Date: Sun, 03 Oct 1999 00:00
15 lines
1187 bytes
Brad Knowles <brad@shub-internet.org> writes:
> Russ Allbery <rra@stanford.edu> wrote:

>> Here are the statistics for newsfeed.stanford.edu, my primary feed
>> machine, running INN 2.2.1 (roughly):

> Man, how do you guys get these statistics?!?

Feature of INN.  Joe Greco wrote it, in fact, IIRC.  It's much easier to
do stuff like that if you're a monolithic daemon, though.

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

Re: INN maxed? Time to add a Diablo router?
#40413
Author: Brad Knowles
Date: Sun, 03 Oct 1999 00:00
16 lines
1438 bytes
In article <yl3dvtnjuv.fsf@windlord.stanford.edu>, Russ Allbery
<rra@stanford.edu> wrote:

> Here are the statistics for newsfeed.stanford.edu, my primary feed
> machine, running INN 2.2.1 (roughly):

    Man, how do you guys get these statistics?!?

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>

Are you a USENET news server administrator outside of North America or
Western Europe?  Would you like a newsfeed from a site in the Freenix
Top 100?  If so, please contact me via private e-mail for details.

Re: INN maxed? Time to add a Diablo router?
#40414
Author: Brad Knowles
Date: Sun, 03 Oct 1999 00:00
31 lines
2171 bytes
In article <yl3dvtnjuv.fsf@windlord.stanford.edu>, Russ Allbery
<rra@stanford.edu> wrote:

> Given that you're using 2.2.1, the difficulty with CNFS is that unified
> overview performance is rather slow.  However, with your reader load, that
> may not actually be a problem.

    Which could mean that if the load were split between transit and news
spool/reader, the news transit server could run CNFS and not worry about
overview (it wouldn't use it anyway), while the news spool/reader server
could continue just the way it is.

    This seems a pretty obvious and simple fix.


    Yes, Diablo does have a CNFS/time-hash like method of storing
articles, and this is much more efficient for article writes, but again I
am not convinced that Diablo is a necessary part of this equation.

    In fact, given the stats provided by the INN timer info you two just
reported, I'm getting more and more jealous of various features in INN
that aren't found in Diablo.  ;-)

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>

Are you a USENET news server administrator outside of North America or
Western Europe?  Would you like a newsfeed from a site in the Freenix
Top 100?  If so, please contact me via private e-mail for details.

Re: INN maxed? Time to add a Diablo router?
#40416
Author: Brad Knowles
Date: Mon, 04 Oct 1999 00:00
27 lines
2006 bytes
In article <37f7fe52$0$7741@news.execpc.com>, jgreco@ns.sol.net (Joe
Greco) wrote:

>                                           Those of us who run Diablo
> typically don't _need_ those sorts of stats.

    Maybe you don't need them, but I'd sure like to have them.  It'd be
really nice to be able to tell just exactly how much time Diablo is
spending in various bits of code, so that I could get some idea of how
busy the machine is (and how much headroom I've got), and where future
coding efforts might best be focussed.

>                                               (Don't forget, I wrote
> the damn thing, it was one of my very compelling reasons to go to
> Diablo).

    May I ask what you saw after implementing that feature that convinced
you to make the switch?

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>

Are you a USENET news server administrator outside of North America or
Western Europe?  Would you like a newsfeed from a site in the Freenix
Top 100?  If so, please contact me via private e-mail for details.

Re: INN maxed? Time to add a Diablo router?
#40425
Author: Russ Allbery
Date: Mon, 04 Oct 1999 00:00
16 lines
1465 bytes
Brad Knowles <brad@shub-internet.org> writes:

> Cool.  I don't suppose that INN will re-read inn.conf on just a simple
> "ctlinnd reload inn.conf", will it?  I'll give it a try, but I'm not
> very hopeful....

See Andrew's followup, but inn.conf is about the only configuration file
that can't be reloaded (or is re-read each time, like control.ctl).  A lot
of the code to make it reloadable is present in the tree, but finishing
that work would require some concerted effort and given how infrequently
one needs to modify inn.conf, it's probably a low priority project.

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

Re: INN maxed? Time to add a Diablo router?
#40431
Author: Brad Knowles
Date: Mon, 04 Oct 1999 00:00
30 lines
2218 bytes
In article <37f8c1e8$0$7753@news.execpc.com>, jgreco@ns.sol.net (Joe
Greco) wrote:

> One minor shared memory segment, a few mods to the mainline, a change
> to the timer accounting function, and it'd be pretty easy to do.  The
> module is basically standalone in design.

    I'd want the same for dnewslink, so there would need to be three
sections to the timer stats -- daemon activity, child activity, and
dnewslink activity.

    I don't suppose you've got your patches to add these features to INN
around anywhere, do you?  I might be able to use them for inspiration....

> Uh, let's see.  Holding up _all_ of your NNTP connections when it decides
> to take a particularly long time to do a disk write is a pretty compelling
> reason.  Not to mention holding up all of your NNTP connections for any
> other function that decides to block for a while.

    Well, that's a good reason to switch from INN to Diablo, but how is
this related to the code you added to INN to do the accounting?

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>

Are you a USENET news server administrator outside of North America or
Western Europe?  Would you like a newsfeed from a site in the Freenix
Top 100?  If so, please contact me via private e-mail for details.

Re: INN maxed? Time to add a Diablo router?
#40432
Author: Brad Knowles
Date: Mon, 04 Oct 1999 00:00
25 lines
2105 bytes
In article <ylvh8ni9vm.fsf@windlord.stanford.edu>, Russ Allbery
<rra@stanford.edu> wrote:

> I don't think you want to get there from that direction.  Like Joe was
> saying in this group earlier, Diablo's multi-process model with shared
> memory is actually closer to a threaded server already than INN's is.

    Hmm.  I was thinking that I could get there in several steps --
forking to monolithic select, add INN-style filter interface, then go to
threaded.

> Just go directly to threaded if you're trying to get there anyway; going
> to a monolithic select loop as an interim step would require writing a
> bunch of code that you'd then throw away again.

    And going directly to threaded would allow an INN-style filter interface?

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>

Are you a USENET news server administrator outside of North America or
Western Europe?  Would you like a newsfeed from a site in the Freenix
Top 100?  If so, please contact me via private e-mail for details.

Re: INN maxed? Time to add a Diablo router?
#40438
Author: 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

Re: INN maxed? Time to add a Diablo router?
#40440
Author: bill davidsen
Date: Mon, 04 Oct 1999 00:00
71 lines
4962 bytes
In article <foo-0210992103530001@192.168.2.3>, Jon Mansey <foo@blah.com> wrote:

| INND timer:
| Code region                   Time    Pct    Invoked  Min(ms)  Avg(ms)  Max(ms)
| article cancel        00:40:43.475   2.8%      64142   10.264   38.095   95.060
| article control       00:39:58.340   2.8%      62750   10.291   38.221   96.357
| article link          00:00:02.422   0.0%     196791    0.000    0.012    0.039
| article write         09:30:23.838  39.7%     748448   29.396   45.726   72.454
| history grep          00:04:41.712   0.3%      37983    0.000    7.417   17.075
| history lookup        01:08:42.681   4.8%   13672409    0.104    0.302    1.850
| history sync          00:00:28.536   0.0%      93569    0.046    0.305    3.489
| history write         03:08:59.200  13.2%     933987    7.011   12.141   17.878
| idle                  01:49:34.946   7.6%    8045117    0.116    0.817    2.118
| perl filter           04:37:14.726  19.3%     906176    9.777   18.357   34.797
| site send             00:22:03.499   1.5%    2245344    0.305    0.589    1.220
| 
| TOTAL: 23:56:58.452   22:02:53.375  92.1%          -        -        -        -
| 
| How do I interpret this? I see it spends most of the time writing, but
| that would be normal, no?

  Not on any of my servers...

Small transit machine:
Code region                   Time    Pct    Invoked  Min(ms)  Avg(ms)  Max(ms)
article cancel        00:52:29.042   3.6%     102269   10.269   30.792   42.866
article control       00:52:28.656   3.6%     102020   10.229   30.863   43.193
article link          00:00:00.000   0.0%          0    0.000    0.000    0.000
article write         03:22:53.282  14.1%     610757   12.153   19.931   29.574
history grep          00:09:24.780   0.7%      51429    2.200   10.982   22.825
history lookup        03:54:23.526  16.3%    2634507    3.209    5.338    8.063
history sync          00:00:59.081   0.1%      67264    0.589    0.878    1.248
history write         03:24:38.778  14.2%     670981   13.854   18.300   24.771
idle                  02:43:02.900  11.3%    4201773    0.781    2.328    5.769
overview write        00:00:00.000   0.0%          0    0.000    0.000    0.000
perl filter           00:33:20.643   2.3%     616041    1.716    3.248    5.132
site send             00:04:06.058   0.3%     610791    0.297    0.403    0.518

TOTAL: 24:00:11.396   15:57:46.746  66.5%          -        -        -        -


Good sized reader machine:
Code region                   Time    Pct    Invoked  Min(ms)  Avg(ms)  Max(ms)
article cancel        00:32:43.355   2.3%      64527    3.617   30.427  589.768
article control       00:32:38.121   2.3%      64320    3.636   30.443  564.971
article link          00:00:00.000   0.0%          0    0.000    0.000    0.000
article write         01:38:49.339   6.9%     388343    5.904   15.268   37.227
history grep          00:04:15.534   0.3%      11531    0.000   22.161  471.484
history lookup        00:23:31.796   1.7%     686323    0.628    2.057   15.245
history sync          00:00:10.199   0.0%      48319    0.117    0.211    1.706
history write         07:23:27.372  31.1%     481629    5.261   55.245 1444.395
idle                  09:44:41.043  41.0%    6850443    0.151    5.121   16.405
perl filter           03:07:49.764  13.2%     428631   12.514   26.292   75.052
site send             00:01:00.184   0.1%     388322    0.123    0.155    0.295
        
TOTAL: 23:44:24.042   23:29:06.707  98.9%          -        -        -        -

  Note that both machines run a fair bit of filtering on what they
accept, these article volumes are a bit low, the transit history lookup
is higher than yours, which is normal. neither spends much time writing
articles, although both spend more than I would like :-(

  Are you running traditional storage instead of CNFS?

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  When taking small children to a carnival, always have them go potty
*before* you let them go on the rides, and let them eat all the junk
food and candy *after*.

Re: INN maxed? Time to add a Diablo router?
#40443
Author: bill davidsen
Date: Mon, 04 Oct 1999 00:00
17 lines
1488 bytes
In article <brad-0410991311360001@brad.techos.skynet.be>,
Brad Knowles <brad@shub-internet.org> wrote:

|     Cool.  I don't suppose that INN will re-read inn.conf on just a simple
| "ctlinnd reload inn.conf", will it?  I'll give it a try, but I'm not very
| hopeful....

  Try ctlinnd. It at least claims to be able to change the interval or
turn the timer off.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  When taking small children to a carnival, always have them go potty
*before* you let them go on the rides, and let them eat all the junk
food and candy *after*.

Re: INN maxed? Time to add a Diablo router?
#40445
Author: Brad Knowles
Date: Mon, 04 Oct 1999 00:00
15 lines
1477 bytes
In article <7t8gr6$7tm$1@xs4.xs4all.nl>, sico@xs4.xs4all.nl (Sico Bruins) wrote:

> Brad runs Diablo and is jealous of us inn users because of this cool
> timer feature. ;-)

    Just one more thing to be added to the list of features for Diablo.  ;-)

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>

Are you a USENET news server administrator outside of North America or
Western Europe?  Would you like a newsfeed from a site in the Freenix
Top 100?  If so, please contact me via private e-mail for details.

Re: INN maxed? Time to add a Diablo router?
#40447
Author: Russ Allbery
Date: Mon, 04 Oct 1999 00:00
19 lines
1344 bytes
bill davidsen <davidsen@tmr.com> writes:

> The advantage of (kernel level) threads is that you can make better use
> of SMP.

[...]

> Not that I want to go back to the days of assembler on 36 bit machines,
> but threads are really effective if you get CPU demand in bursts and can
> gain performance by having more on tap for a moment.

Right, async I/O isn't really as good as threading in general.  It has the
advantage of being a lot easier, though, both to write and to debug
(debugging threaded applications can be a horrid pain).

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

Re: INN maxed? Time to add a Diablo router?
#40449
Author: Brad Knowles
Date: Mon, 04 Oct 1999 00:00
18 lines
1628 bytes
In article <slrn7veimb.irn.niels@liquid.tpb.net>, niels@usenet.bakker.net
(N) wrote:

> By enabling it in inn.conf.  The switch to toggle is `timer' -- make it
> non-zero, 300 is a good value.

    Cool.  I don't suppose that INN will re-read inn.conf on just a simple
"ctlinnd reload inn.conf", will it?  I'll give it a try, but I'm not very
hopeful....

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>

Are you a USENET news server administrator outside of North America or
Western Europe?  Would you like a newsfeed from a site in the Freenix
Top 100?  If so, please contact me via private e-mail for details.

Re: INN maxed? Time to add a Diablo router?
#40450
Author: Richard Michael Todd
Date: Mon, 04 Oct 1999 00:00
15 lines
1827 bytes
Russ Allbery <rra@stanford.edu> writes:

> See Andrew's followup, but inn.conf is about the only configuration file
> that can't be reloaded (or is re-read each time, like control.ctl).  A lot
> of the code to make it reloadable is present in the tree, but finishing
> that work would require some concerted effort and given how infrequently
> one needs to modify inn.conf, it's probably a low priority project.

Especially since, in my experience, if you really *do* need something you
changed in inn.conf to take effect immediately, ctlinnd xexec '' will work
in getting innd to reload its conf file.  Of course, it has the minor 
side effect of shutting down and restarting innd and its subprocesses,
but that's usually fairly quick. :-)

Re: INN maxed? Time to add a Diablo router?
#40454
Author: Joe Greco
Date: Mon, 04 Oct 1999 00:00
60 lines
3790 bytes
In news.software.nntp article <brad-0410991314520001@brad.techos.skynet.be>, brad@shub-internet.org (Brad Knowles) wrote:
:In article <ylvh8olmsi.fsf@windlord.stanford.edu>, Russ Allbery
:<rra@stanford.edu> wrote:
:
:> Feature of INN.  Joe Greco wrote it, in fact, IIRC.  It's much easier to
:> do stuff like that if you're a monolithic daemon, though.
:
:    I'm thinking that I might see what it would take to turn Diablo into a
:single select-based daemon, so that I could then enable an INN-like filter
:interface.

You need a lobotomy.

:    I think that would bring me a long ways towards making Diablo as fast
:as INN, and once I got there than I could look into what it would take to
:make the program multi-threaded, so that hopefully I could start knocking
:on the doors of NNTPRelay.

You need a lobotomy, followed by a jello-head-fill and a few hours in the
fridge.

:    However, I should probably also look into what it would take to make
:it run chrooted as a non-priviledged user.  Last thing you want with these
:monolithic daemons is to have them be a security hole....

You're insane.

Brad, Diablo currently _has_ what INN lacks:  a model that allows
concurrency on the inbound side.  INN is fatally flawed in that it is a
select-based demon (daemon too, but I mean _demon_).  When it is writing
to disk - your network I/O stops.  When a Diablo inbound feed process is
writing to disk, other processes cheerfully continue communicating with
peers, rejecting history entries, or retrieving articles.  Diablo is most
of what you'd want to see in a news reception engine.

Now, if you want to talk latency reduction, it might be possible to do
some architectural re-engineering of Diablo, along the lines of things that
I have posted here previously.  You are looking to optimize or eliminate
various bottlenecks, of which Diablo has far fewer than INN.  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'd allow each child to independently pass off
articles to the filter.  Doing the same thing to the outbound feed process
would also help, and would trivialize the master Diablo process into mostly
accepting new connections.

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.

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 :-( :-( :-(

... JG

Re: INN maxed? Time to add a Diablo router?
#40457
Author: Andrew Gierth
Date: Mon, 04 Oct 1999 00:00
17 lines
1549 bytes
>>>>> "Brad" == Brad Knowles <brad@shub-internet.org> writes:

 >> By enabling it in inn.conf.  The switch to toggle is `timer' --
 >> make it non-zero, 300 is a good value.

 Brad>     Cool.  I don't suppose that INN will re-read inn.conf on
 Brad> just a simple "ctlinnd reload inn.conf", will it?  I'll give it
 Brad> a try, but I'm not very hopeful....

$ ctlinnd timer 300

works just fine on a running INN :-)

-- 
Andrew.

Re: INN maxed? Time to add a Diablo router?
#40460
Author: Russ Allbery
Date: Mon, 04 Oct 1999 00:00
26 lines
1952 bytes
Brad Knowles <brad@shub-internet.org> writes:
> Russ Allbery <rra@stanford.edu> wrote:

>> Feature of INN.  Joe Greco wrote it, in fact, IIRC.  It's much easier
>> to do stuff like that if you're a monolithic daemon, though.

> I'm thinking that I might see what it would take to turn Diablo into a
> single select-based daemon, so that I could then enable an INN-like
> filter interface.

> I think that would bring me a long ways towards making Diablo as fast as
> INN, and once I got there than I could look into what it would take to
> make the program multi-threaded, so that hopefully I could start
> knocking on the doors of NNTPRelay.

I don't think you want to get there from that direction.  Like Joe was
saying in this group earlier, Diablo's multi-process model with shared
memory is actually closer to a threaded server already than INN's is.
Just go directly to threaded if you're trying to get there anyway; going
to a monolithic select loop as an interim step would require writing a
bunch of code that you'd then throw away again.

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

Re: INN maxed? Time to add a Diablo router?
#40464
Author: Brad Knowles
Date: Mon, 04 Oct 1999 00:00
28 lines
2130 bytes
In article <ylvh8olmsi.fsf@windlord.stanford.edu>, Russ Allbery
<rra@stanford.edu> wrote:

> Feature of INN.  Joe Greco wrote it, in fact, IIRC.  It's much easier to
> do stuff like that if you're a monolithic daemon, though.

    I'm thinking that I might see what it would take to turn Diablo into a
single select-based daemon, so that I could then enable an INN-like filter
interface.

    I think that would bring me a long ways towards making Diablo as fast
as INN, and once I got there than I could look into what it would take to
make the program multi-threaded, so that hopefully I could start knocking
on the doors of NNTPRelay.


    However, I should probably also look into what it would take to make
it run chrooted as a non-priviledged user.  Last thing you want with these
monolithic daemons is to have them be a security hole....

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>

Are you a USENET news server administrator outside of North America or
Western Europe?  Would you like a newsfeed from a site in the Freenix
Top 100?  If so, please contact me via private e-mail for details.

Re: INN maxed? Time to add a Diablo router?
#40467
Author: Russ Allbery
Date: Mon, 04 Oct 1999 00:00
25 lines
1841 bytes
Brad Knowles <brad@shub-internet.org> writes:
> jgreco@ns.sol.net (Joe Greco) wrote:

>> 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.

Different kind of async I/O.  The stuff that Joe's talking about is the
kind where you tell the system to go do a disk write, it returns
immediately, and you go on with the rest of your life, and down the road
when the disk write finishes the system tells you it's done.

Solves some of the same problems that people use threads for, but without
as much baggage.

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

Re: INN maxed? Time to add a Diablo router?
#40473
Author: Joe Greco
Date: Mon, 04 Oct 1999 00:00
34 lines
2393 bytes
In news.software.nntp article <ylpuyuakvk.fsf@windlord.stanford.edu>, Russ Allbery <rra@stanford.edu> wrote:
:bill davidsen <davidsen@tmr.com> writes:
:
:> The advantage of (kernel level) threads is that you can make better use
:> of SMP.
:
:[...]
:
:> Not that I want to go back to the days of assembler on 36 bit machines,
:> but threads are really effective if you get CPU demand in bursts and can
:> gain performance by having more on tap for a moment.
:
:Right, async I/O isn't really as good as threading in general.  It has the
:advantage of being a lot easier, though, both to write and to debug
:(debugging threaded applications can be a horrid pain).

Async I/O will ultimately run into the 100%-busy-in-core-loop problem as
well; you can only execute a program "so fast".  It'll merely take the disk
I/O out of the loop and would essentially be like removing all the I/O wait
states in INN.  This'll still max out when you need all your CPU just to
receive articles (for example), and can't really take advantage of N-way
SMP.

A nifty kernel-threaded model "should" have the potential to do better.
And, in many ways, I'd think it would be _easier_ to write, since you can
remove the complex logic that handles multiple connections, attempts to
optimize socket I/O, etc.  I don't really know how well a user-threaded
model would work, but I believe some use async I/O in the background
anyways so it might actually work nearly-as-well as the async I/O model
would allow.

... JG

Re: INN maxed? Time to add a Diablo router?
#40476
Author: Joe Greco
Date: Mon, 04 Oct 1999 00:00
32 lines
2265 bytes
In news.software.nntp article <brad-0410991316520001@brad.techos.skynet.be>, brad@shub-internet.org (Brad Knowles) wrote:
:In article <37f7fe52$0$7741@news.execpc.com>, jgreco@ns.sol.net (Joe
:Greco) wrote:
:
:>                                           Those of us who run Diablo
:> typically don't _need_ those sorts of stats.
:
:    Maybe you don't need them, but I'd sure like to have them.  It'd be
:really nice to be able to tell just exactly how much time Diablo is
:spending in various bits of code, so that I could get some idea of how
:busy the machine is (and how much headroom I've got), and where future
:coding efforts might best be focussed.

One minor shared memory segment, a few mods to the mainline, a change
to the timer accounting function, and it'd be pretty easy to do.  The
module is basically standalone in design.

:>                                               (Don't forget, I wrote
:> the damn thing, it was one of my very compelling reasons to go to
:> Diablo).
:
:    May I ask what you saw after implementing that feature that convinced
:you to make the switch?

Uh, let's see.  Holding up _all_ of your NNTP connections when it decides
to take a particularly long time to do a disk write is a pretty compelling
reason.  Not to mention holding up all of your NNTP connections for any
other function that decides to block for a while.

... JG

Re: INN maxed? Time to add a Diablo router?
#40478
Author: bill davidsen
Date: Mon, 04 Oct 1999 00:00
29 lines
2202 bytes
In article <ylr9jbdsan.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:

| Different kind of async I/O.  The stuff that Joe's talking about is the
| kind where you tell the system to go do a disk write, it returns
| immediately, and you go on with the rest of your life, and down the road
| when the disk write finishes the system tells you it's done.
| 
| Solves some of the same problems that people use threads for, but without
| as much baggage.

  The advantage of (kernel level) threads is that you can make better
use of SMP. There are certainly things to be said in favor of both
approaches, but the UNIX model of async i/o is not as flexible as
implementations I used decades ago, which allowed you to specify a
procedure to be executed out of band, like a signal, and which allowed
both 'wait for any i/o to complete" and "wait for all i/o to complete."

  Not that I want to go back to the days of assembler on 36 bit
machines, but threads are really effective if you get CPU demand in
bursts and can gain performance by having more on tap for a moment.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  When taking small children to a carnival, always have them go potty
*before* you let them go on the rides, and let them eat all the junk
food and candy *after*.

Re: INN maxed? Time to add a Diablo router?
#40480
Author: Russ Allbery
Date: Mon, 04 Oct 1999 00:00
39 lines
2748 bytes
Brad Knowles <brad@shub-internet.org> writes:
> Russ Allbery <rra@stanford.edu> wrote:

>> I don't think you want to get there from that direction.  Like Joe was
>> saying in this group earlier, Diablo's multi-process model with shared
>> memory is actually closer to a threaded server already than INN's is.

> Hmm.  I was thinking that I could get there in several steps -- forking
> to monolithic select, add INN-style filter interface, then go to
> threaded.

Forking is more like threading.  At the beginning of the life of a
threaded server, you spin off some threads, and then you spin off more
threads for incoming connections and the like.  The main difference is the
mechanism whereby threads are spun off and the mechanism for handling
shared data (do you explicitly mark things as shared, or explicitly mark
things as private).

> And going directly to threaded would allow an INN-style filter
> interface?

Sure, if you design it to do so.  The key requirement for an INN-style
filter is for the filter to run inside the same process as the process
accepting articles from the network so that it can pass articles to the
filter without doing a copy.  A threaded server can easily do that.

One thing to bear in mind, though, is that your filter probably isn't
going to play nicely with threads, so you'll want to single-thread it.
Perl's threading support really isn't up to the task; Python's may be, but
the amount of locking may still be pretty heavy and hurt performance.
Probably better to instantiate a single copy of the filter in one thread
and pass all incoming articles through it.  Network and disk are still
your bottlenecks and will benefit the most from concurrency, so that
shouldn't hurt your performance that badly.

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

Re: INN maxed? Time to add a Diablo router?
#40481
Author: Brad Knowles
Date: Mon, 04 Oct 1999 00:00
18 lines
1761 bytes
In article <ylr9jbdsan.fsf@windlord.stanford.edu>, Russ Allbery
<rra@stanford.edu> wrote:

> Different kind of async I/O.  The stuff that Joe's talking about is the
> kind where you tell the system to go do a disk write, it returns
> immediately, and you go on with the rest of your life, and down the road
> when the disk write finishes the system tells you it's done.

    Oh.  Will someone please hand me the tall white pointy hat?

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>

Are you a USENET news server administrator outside of North America or
Western Europe?  Would you like a newsfeed from a site in the Freenix
Top 100?  If so, please contact me via private e-mail for details.

Re: INN maxed? Time to add a Diablo router?
#40483
Author: Brad Knowles
Date: Mon, 04 Oct 1999 00:00
69 lines
3991 bytes
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.

    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.


    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....

>                                                               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?

>                          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.

> 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?

> 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.

    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.

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>

Are you a USENET news server administrator outside of North America or
Western Europe?  Would you like a newsfeed from a site in the Freenix
Top 100?  If so, please contact me via private e-mail for details.

Re: INN maxed? Time to add a Diablo router?
#40491
Author: Kai 'wusel' Siering
Date: Mon, 04 Oct 1999 00:00
22 lines
1834 bytes
Katsuhiro Kondou <kondou@uxd.fc.nec.co.jp> wrote:

% I suspect you're running traditional.  You will get
% enough feed performance, if you run cnfs.  And you'll
% get enough reader performance, if you run 2.3.

I'm a little confused here; since 2.3 is work-in-progress, I would
not recommend it to anyone for production work yet (both because
of the clearly stated experimental status and because I (try to at
least) follow inn-workers) -- yet quite some of you are actively
pushing people to run 2.3 today. Do I miss something obvious or are
you really promoting the use of the evolving 2.3 these days?

Just curios,
			kai

-- 
Kai 'wusel' Siering                       eMail @ home: wusel@uu.org
Traveller on the Information Highway doing full-time administration.
The views expressed here are not neccessarily those of any employer.

Re: INN maxed? Time to add a Diablo router?
#40503
Author: Brad Knowles
Date: Tue, 05 Oct 1999 00:00
37 lines
2502 bytes
In article <37f9bea6$0$10177@news.execpc.com>, jgreco@ns.sol.net (Joe
Greco) wrote:

> "Strange that I cannot."

    I was under the impression that Solaris did both threading and shared
memory mmap() relatively well.  Is this not correct?

    I know that FreeBSD does shared memory mmap() pretty well (although
INN 2.3 appears to have some problems with FreeBSD in some circumstances
on certain hardware configurations), but for the moment it's my
understanding that it only supports POSIX threads in userland, and doesn't
currently have a kernel threads implementation.

    I understand that Linux has a pretty decent kernel threading
implementation, but currently has a poor shared memory mmap() situation.

    I don't really know all that much about other OSes with respect to
these two particular issues, although I'd be very interested to learn.

> Or it may.  At least that way you have the chance.

    So long as they support POSIX threading in userland, they should at
least be not much worse than individual processes, and you should still be
able to make use of shared memory, etc..., right?

    In other words, on most systems, using threading shouldn't be much of
a loss, and on some systems it could be a pretty big win, right?

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>

Are you a USENET news server administrator outside of North America or
Western Europe?  Would you like a newsfeed from a site in the Freenix
Top 100?  If so, please contact me via private e-mail for details.

Re: INN maxed? Time to add a Diablo router?
#40511
Author: Russ Allbery
Date: Tue, 05 Oct 1999 00:00
14 lines
1178 bytes
Brad Knowles <brad@shub-internet.org> writes:

> Awright, I think I got this information being collected and logged, but
> how do you get this information summarized in the nice format you've got
> here?

innreport.  It has a Diablo module already, but it probably needs some
updating and tweaking.  ftp.oleane.net in /pub/mirrors/unix/news/innreport
has the latest versions.

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

Re: INN maxed? Time to add a Diablo router?
#40518
Author: Russ Allbery
Date: Tue, 05 Oct 1999 00:00
15 lines
1354 bytes
Brad Knowles <brad@shub-internet.org> writes:

> I don't really know all that much about other OSes with respect to these
> two particular issues, although I'd be very interested to learn.

I haven't heard that it's poor, although I understand that it's faster in
the current 2.3 series.  Even if it's currently poor and fixed in 2.3,
though, that's good enough for your purposes, since I'm quite certainly
you wouldn't have managed to rewrite Diablo to be threaded before Linux
2.4 comes out.  :)

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

Re: INN maxed? Time to add a Diablo router?
#40520
Author: bill davidsen
Date: Tue, 05 Oct 1999 00:00
25 lines
2045 bytes
In article <7tcv4u$te4$1@nnrp1.deja.com>,
Christopher M Sedore  <cmsedore@maxwell.syr.edu> wrote:

| It depends on how big N gets.  If N==2, then I'm not sure that it
| really matters.  At 2 processors, you get a fairly nice spilt between
| handling io (disk/net) and actually mucking with articles.  At N==3,
| running an external process for filtering means you get decent use of 3
| processors.  Frankly, I'd be a little shocked if someone could
| demonstrate need for quad processing for transit.

  Innfeed uses non-zero CPU. Therefore a transit site with a reasonable
number of feeds will probably be able to get some use from another CPU.
I'm not saying that you would really need it, but the propigation delay
would probably go down. If you are going to take the performance hit
that SMP involves in terms of kernel locking, then more processors don't
hurt, and usually help, since they have a chance to run in another part
of the kernel.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  When taking small children to a carnival, always have them go potty
*before* you let them go on the rides, and let them eat all the junk
food and candy *after*.

Re: INN maxed? Time to add a Diablo router?
#40521
Author: bill davidsen
Date: Tue, 05 Oct 1999 00:00
36 lines
2625 bytes
In article <7tbbf7$t4f$2@inn.do.mms.mt.nec.co.jp>,
Katsuhiro Kondou  <kondou@uxd.fc.nec.co.jp> wrote:

| I don't think 2.3 is so unstable, although 2.3 is still
| in experimental state.  And I'm going to replace our
| reader boxes with 2.3 as production.

  I have to agree, at least the version I'm running seems pretty good as
a reader or transit (no overview) box. There are still some learning
experiences to be had, and as soon as I have a fix I'll post.

  However, buffindexed is for the strong of stomache, I think.
Fortunately it's so well hidden that no one will try it unless they
really look for it, in which case you get what you deserve. No one will
complain about bad documentation here, there's about none. I wanted to
try it, so I built it on a small transit machine I use as a fill-in. I
asked it to build overview on about 12GB of articles in CNFS form, and
it beat the disk for about 100 sec, then entered a "persistent
vegatative state" using about 2% of one CPU for system time, and reading
and writing about 100k/sec total i/o. It's been doing this for hours
now, tomorrow I'll kill it and turn off overview for transit use.

  Not complaining, someone said buffindex was good for both read and
write, and it may be, but if makehistory won't work in case of an oops
it's not ready for prime time. Not surprising in development software.

  If the overview won't build in tradindexed mode I will drop back to
09-15, that's been pretty nice and will rebuild everything.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  When taking small children to a carnival, always have them go potty
*before* you let them go on the rides, and let them eat all the junk
food and candy *after*.

Re: INN maxed? Time to add a Diablo router?
#40526
Author: Andrew Gierth
Date: Tue, 05 Oct 1999 00:00
16 lines
1690 bytes
>>>>> "Russ" == Russ Allbery <rra@stanford.edu> writes:

 Russ> When I was trying to figure out how I would do this, one of the
 Russ> worries I had about threading with blocking I/O is that it
 Russ> feels like it would prevent you from doing an orderly shutdown
 Russ> of the entire news system in a bounded amount of time.  Or am I
 Russ> missing something?

You have to handle timeouts somehow anyway; you can't just sit forever
in read(). So you use the same mechanism (whether it's poll(),
signals, or SO_RCVTIMEO) to handle shutdown too.

-- 
Andrew.

Re: INN maxed? Time to add a Diablo router?
#40532
Author: Brad Knowles
Date: Tue, 05 Oct 1999 00:00
30 lines
2309 bytes
In article <37f95476$0$7750@news.execpc.com>, jgreco@ns.sol.net (Joe
Greco) wrote:

> 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.

    IIIC, what you'd basically be doing is trading problems with mmap() on
shared memory for problems with threading.  Some OSes seem to handle one
better than the other, and I can think of only one OS that I believe does
them both fairly well.

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

    Well, in theory, even with the current model you should be mostly
reading them out of disk cache that hasn't been flushed yet, right?  This
would just be an application-sepcific way of doing what is today handled
by general-purpose OS caching algorithms.

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>

Are you a USENET news server administrator outside of North America or
Western Europe?  Would you like a newsfeed from a site in the Freenix
Top 100?  If so, please contact me via private e-mail for details.

Re: INN maxed? Time to add a Diablo router?
#40533
Author: Russ Allbery
Date: Tue, 05 Oct 1999 00:00
25 lines
2018 bytes
Andrew Gierth <andrew@erlenstar.demon.co.uk> writes:

> You have to handle timeouts somehow anyway; you can't just sit forever
> in read(). So you use the same mechanism (whether it's poll(), signals,
> or SO_RCVTIMEO) to handle shutdown too.

Everything I've read on the subject seems to indicate that signals are the
last thing you want to try to use in combination with threads under most
threading models.

For the other two, this is getting into areas of network programming that
I don't know well enough to make informed choices (need to sit down and
spend quality time with Unix Network Programming and TCP/IP Illustrated at
some point).  poll() is essentially like select(), yes?  I seem to recall
having problems before with sockets returning ready to write with select()
and then still blocking when one writes to them.  What are the advantages
of poll() over select() beyond the file descriptor limit thing on Solaris?

And I assume SO_RCVTIMEO is a socket option, but that's the only thing I
know about it.  Where should i look for documentation?

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

Re: INN maxed? Time to add a Diablo router?
#40538
Author: Andrew Gierth
Date: Tue, 05 Oct 1999 00:00
61 lines
3801 bytes
>>>>> "Russ" == Russ Allbery <rra@stanford.edu> writes:

 >> You have to handle timeouts somehow anyway; you can't just sit
 >> forever in read(). So you use the same mechanism (whether it's
 >> poll(), signals, or SO_RCVTIMEO) to handle shutdown too.

 Russ> Everything I've read on the subject seems to indicate that
 Russ> signals are the last thing you want to try to use in
 Russ> combination with threads under most threading models.

For signals directed at the whole process I'd agree; but I was
thinking of pthread_kill, which damn well ought to work reasonably.

I'm probably going to try this out myself (using a timeout thread
that goes around sending a signal, via pthread_kill, to all the
input threads at some suitable interval). By keeping that signal
blocked in the thread except when actually doing reads & writes,
and not trying to do anything at all in the signal handler, just
using it to force an EINTR return, I think I can keep things clean
enough.

 Russ> For the other two, this is getting into areas of network
 Russ> programming that I don't know well enough to make informed
 Russ> choices (need to sit down and spend quality time with Unix
 Russ> Network Programming and TCP/IP Illustrated at some point).
 Russ> poll() is essentially like select(), yes?

yes

 Russ> I seem to recall having problems before with sockets returning
 Russ> ready to write with select() and then still blocking when one
 Russ> writes to them.

yes, that can happen if you write enough data. A workaround might

 Russ> What are the advantages of poll() over select() beyond the file
 Russ> descriptor limit thing on Solaris?

poll has a cleaner interface, especially when the descriptor space
being used is very sparse, but select is more portable (though poll is
percolating through even to the pure BSD systems now).

 Russ> And I assume SO_RCVTIMEO is a socket option, but that's the
 Russ> only thing I know about it.  Where should i look for
 Russ> documentation?

man setsockopt (for what little documentation there is, and assuming
your system supports it, which Solaris for example doesn't)

On systems that _do_ support it it causes read operations to abort and
return EWOULDBLOCK if they end up blocking for more than the specified
time (passed as a struct timeval) without receiving data from the
protocol. SO_SNDTIMEO does a similar thing for writes (but in that
case the timer may be reset every time data is delivered to the
protocol, so it may take longer than expected to time out if data is
still flowing).

-- 
Andrew.

Re: INN maxed? Time to add a Diablo router?
#40540
Author: Christopher M Sedore
Date: Tue, 05 Oct 1999 00:00
53 lines
2946 bytes
In article <37f94ee5$0$7742@news.execpc.com>,
  jgreco@ns.sol.net (Joe Greco) wrote:
[...]
> Async I/O will ultimately run into the 100%-busy-in-core-loop problem
as
> well; you can only execute a program "so fast".  It'll merely take
the disk
> I/O out of the loop and would essentially be like removing all the
I/O wait
> states in INN.  This'll still max out when you need all your CPU just
to
> receive articles (for example), and can't really take advantage of N-
way
> SMP.

It depends on how big N gets.  If N==2, then I'm not sure that it
really matters.  At 2 processors, you get a fairly nice spilt between
handling io (disk/net) and actually mucking with articles.  At N==3,
running an external process for filtering means you get decent use of 3
processors.  Frankly, I'd be a little shocked if someone could
demonstrate need for quad processing for transit.

> A nifty kernel-threaded model "should" have the potential to do
better.
> And, in many ways, I'd think it would be _easier_ to write, since you
can
> remove the complex logic that handles multiple connections, attempts
to
> optimize socket I/O, etc.  I don't really know how well a user-
threaded
> model would work, but I believe some use async I/O in the background
> anyways so it might actually work nearly-as-well as the async I/O
model
> would allow.

Having written news software covering three different approaches
(multiple threads/blocking io;thread pool/async io;single thread/async
io), I can say that it is significantly easier to do thread per
connection with blocking io.  Maybe my brain isn't big enough, but
having to deal with tracking state through async io while using
multiple threads and mutexes can drive a person crazy.

Most of the user-threading models I've seen assume disk io is instant.
Thus they face significant limitations when instant isn't quite how it
works out.

-Chris


Sent via Deja.com http://www.deja.com/
Before you buy.

Re: INN maxed? Time to add a Diablo router?
#40544
Author: bill davidsen
Date: Tue, 05 Oct 1999 00:00
27 lines
2027 bytes
In article <brad-0510991203350001@brad.techos.skynet.be>,
Brad Knowles <brad@shub-internet.org> wrote:

|     I know that FreeBSD does shared memory mmap() pretty well (although
| INN 2.3 appears to have some problems with FreeBSD in some circumstances
| on certain hardware configurations), but for the moment it's my
| understanding that it only supports POSIX threads in userland, and doesn't
| currently have a kernel threads implementation.

  As soon as I add code to ctxbench to do threads I will have an answer
to that.

|     I understand that Linux has a pretty decent kernel threading
| implementation, but currently has a poor shared memory mmap() situation.

  I've heard this. I have not been bitten by it, but that doesn't mean
there isn't a problem. Anything I've tried has worked on Linux, AIX and
OpenServer, and some stuff has been used on BSD without complaints
coming back.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  When taking small children to a carnival, always have them go potty
*before* you let them go on the rides, and let them eat all the junk
food and candy *after*.

Re: INN maxed? Time to add a Diablo router?
#40545
Author: Katsuhiro Kondou
Date: Tue, 05 Oct 1999 00:00
17 lines
1877 bytes
In article <939061470.992682@nnca-gtso-1.news.mediaways.net>,
	wusel@uu.org (Kai 'wusel' Siering) wrote;

} I'm a little confused here; since 2.3 is work-in-progress, I would
} not recommend it to anyone for production work yet (both because
} of the clearly stated experimental status and because I (try to at
} least) follow inn-workers) -- yet quite some of you are actively
} pushing people to run 2.3 today. Do I miss something obvious or are
} you really promoting the use of the evolving 2.3 these days?

I don't think 2.3 is so unstable, although 2.3 is still
in experimental state.  And I'm going to replace our
reader boxes with 2.3 as production.
-- 
Katsuhiro Kondou

Re: INN maxed? Time to add a Diablo router?
#40546
Author: Brad Knowles
Date: Tue, 05 Oct 1999 00:00
24 lines
1948 bytes
In article <7tcv4u$te4$1@nnrp1.deja.com>, Christopher M Sedore
<cmsedore@maxwell.syr.edu> wrote:

> Having written news software covering three different approaches
> (multiple threads/blocking io;thread pool/async io;single thread/async
> io), I can say that it is significantly easier to do thread per
> connection with blocking io.

    Speaking only for my totally ignorant self, I would assume that
threading with blocking I/O should also be sufficiently close to optimal
performance that I wouldn't think it would be necessary or desirable to
really go beyond this point.

    However, I'd love to hear more details about your experiences, since
you've been there and done that.  ;-)

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>

Are you a USENET news server administrator outside of North America or
Western Europe?  Would you like a newsfeed from a site in the Freenix
Top 100?  If so, please contact me via private e-mail for details.

Re: INN maxed? Time to add a Diablo router?
#40554
Author: Russ Allbery
Date: Tue, 05 Oct 1999 00:00
16 lines
1435 bytes
Brad Knowles <brad@shub-internet.org> writes:

> Speaking only for my totally ignorant self, I would assume that
> threading with blocking I/O should also be sufficiently close to optimal
> performance that I wouldn't think it would be necessary or desirable to
> really go beyond this point.

When I was trying to figure out how I would do this, one of the worries I
had about threading with blocking I/O is that it feels like it would
prevent you from doing an orderly shutdown of the entire news system in a
bounded amount of time.  Or am I missing something?

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

Re: INN maxed? Time to add a Diablo router?
#40560
Author: Joe Greco
Date: Tue, 05 Oct 1999 00:00
35 lines
2558 bytes
In news.software.nntp article <brad-0510990950470001@dialup401.brussels2.skynet.be>, brad@shub-internet.org (Brad Knowles) wrote:
:In article <37f95476$0$7750@news.execpc.com>, jgreco@ns.sol.net (Joe
:Greco) wrote:
:> 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.
:
:    IIIC, what you'd basically be doing is trading problems with mmap() on
:shared memory for problems with threading.  Some OSes seem to handle one
:better than the other, and I can think of only one OS that I believe does
:them both fairly well.

"Strange that I cannot."

:> So low latency connections are actually getting fed articles that may
:> not have been written to disk yet.
:
:    Well, in theory, even with the current model you should be mostly
:reading them out of disk cache that hasn't been flushed yet, right?  This
:would just be an application-sepcific way of doing what is today handled
:by general-purpose OS caching algorithms.

Yeah, but you're crossing the process boundary a few times (copy data to
kernelland, copy data to userland...).  Using shared memory "solves" that
but you still have context switches to deal with.  Using threads 
eliminates even that, but depending on your threads implementation, may 
not be terribly more efficient than individual processes.

Or it may.  At least that way you have the chance.

... JG

Re: INN maxed? Time to add a Diablo router?
#40562
Author: Brad Knowles
Date: Tue, 05 Oct 1999 00:00
21 lines
1627 bytes
In article <7tb62v$c3c$1@newssvr02.news.prodigy.com>, davidsen@tmr.com
(bill davidsen) wrote:

> Small transit machine:
> Code region                   Time    Pct    Invoked  Min(ms)  Avg(ms) 
Max(ms)
> article cancel        00:52:29.042   3.6%     102269   10.269   30.792  
42.866

    Awright, I think I got this information being collected and logged,
but how do you get this information summarized in the nice format you've
got here?

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>

Are you a USENET news server administrator outside of North America or
Western Europe?  Would you like a newsfeed from a site in the Freenix
Top 100?  If so, please contact me via private e-mail for details.

Re: INN maxed? Time to add a Diablo router?
#40602
Author: bill davidsen
Date: Wed, 06 Oct 1999 00:00
32 lines
2461 bytes
In article <7tdrf9$u8u$1@newssvr02.news.prodigy.com>,
bill davidsen <davidsen@tmr.com> wrote:

|   However, buffindexed is for the strong of stomache, I think.
| Fortunately it's so well hidden that no one will try it unless they
| really look for it, in which case you get what you deserve. No one will
| complain about bad documentation here, there's about none. I wanted to
| try it, so I built it on a small transit machine I use as a fill-in. I
| asked it to build overview on about 12GB of articles in CNFS form, and
| it beat the disk for about 100 sec, then entered a "persistent
| vegatative state" using about 2% of one CPU for system time, and reading
| and writing about 100k/sec total i/o. It's been doing this for hours
| now, tomorrow I'll kill it and turn off overview for transit use.

  Well, after a LONG time the makehistory finally ended with an "out of
space" message. I guess I don't understand how this works, what little
doc there is looks like a cycbuff which never runs out of space, just
auto-expires. In any case I'll wait for the full doc, if it can't do
overview for 12GB of articles in 2GB of buffer then I'll run on without
it.

  Suggestion for future documentation updates, perhaps some hint as to
the ratio between overview size needed for buffindexed  and article
storage would be in order.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  When taking small children to a carnival, always have them go potty
*before* you let them go on the rides, and let them eat all the junk
food and candy *after*.

Page 1 of 2 • 55 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