🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
90 messages
90 total messages Page 1 of 2 Started by Bill Gunshannon Mon, 26 Apr 1999 00:00
Page 1 of 2 • 90 total messages
Re: Submitting to Freenix
#37025
Author: Bill Gunshannon
Date: Mon, 26 Apr 1999 00:00
32 lines
2325 bytes
Well, I promised to return with more info on the effects of splitting
in a few days all my feeds into "big" and "small" feeds. (in case
anyone here actually cares!!)  So here it is.  The amount of outgoing
news from my Diablo box has more than doubled!!  That's right, more than
twice as much of what I offer is now being accepted by my peers.  I still
see backlogs (some permanent, some transient) on the "big" queues, but it
seems even the slowest of my peers (well, except for one) have no problem
keeping up with the "small" queue.

So then, now the big question.  Given the obvious improvement in 
performance and the fact that it was immediately noticable, would
this not be a good idea for USENET in general??  I have seen no
adverse side effects.  No increase in load.  No change in incoming
news performance.  Only an increase in my ability to get news further
down the pipe.  What am I missing??  Why doesn't everyone do it??  
Granted that some sites obviously have no lengthy backlog between
peers it still seems that they would see a decrease in latency for
smaller articles even if it was very small.  Afterall, even across
the ethernet between my reader and my feeder the time it takes to
send a >64K message is still finite.  I would think that for someone
who is counting miliseconds in their climb up Freenix even this would
be significant.

bill

-- 
Bill Gunshannon          |  de-moc-ra-cy (di mok' ra see) n.  Three wolves
bill@cs.uofs.edu         |  and a sheep voting on what's for dinner.
University of Scranton   |
Scranton, Pennsylvania   |         #include <std.disclaimer.h>   

Re: Submitting to Freenix
#37046
Author: Russ Allbery
Date: Tue, 27 Apr 1999 00:00
17 lines
1274 bytes
Arthur Hagen <art@flying.broomstick.com> writes:

> Is there any advantage to setting up two different funnel feeds?

> As long as they have different names in newsfeeds/innfeed.conf you can
> feed them through the same funnel.  And since CPU use isn't much of an
> issue with outgoing feeds, I think it would be faster to use the same
> funnel feed?

You could.  I split it that way because the articles handled by the two
feeds are mutually exclusive and I have a *lot* of outgoing feeds and
wanted to distribute the work load a bit farther.

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

Re: Submitting to Freenix
#37050
Author: Brad Knowles
Date: Tue, 27 Apr 1999 00:00
68 lines
3853 bytes
In article <7g4soa$p7e$1@info.cs.uofs.edu>, bill@cs.uofs.edu (Bill
Gunshannon) wrote:

> Here's some examples:

    Interesting.  You seem to have largely chosen 64KB as your break-over
point between "small" and "large" postings.


    From the stats I've seen (looking at stats such as
<http://www.news-feed.inet.tele.dk/innreport/news-notice.1999.04.21-05_01_14.html>),
somewhere around 85% of all articles are around 10KB in size.  If you want
to go to 90%, you do need to expand to around 64KB.  If you want to go as
high as 95%, you need to increase this further to around 300KB.  You don't
seem to hit 99% until around 512KB.

    OTOH, if you want to look at percentage of volume, only 10% of the
volume is comprised by articles smaller than about 64KB.  You see 20% of
the volume with articles up to 160KB.  Somewhere between 35-40% of the
articles are about 300KB or smaller.  About 60% of the articles are around
512KB or smaller, and 95% of the articles are right about 600KB or
smaller.


    So, on further reflection, it would seem that 64KB would appear to be
a good balance point -- 90% of the articles but only 10% of the volume. 
If you wanted to pick a slightly lower balance point, 16KB would appear to
be good with more than 85% of the articles and less than 5% of the volume.

> Nothing particularly scientific about it and I am sure with some tuning 
> there are optimum settings.

    My guess is that you've found a pretty good setting as a first
approximation, and that you're not too likely to improve a great deal over
this choice.

> Can't be.  I gave the "big" queue an entry of "n1" in my dnntpspool.ctl and
> reduced the original "n" entry by one for the "small" queue.  So the max
> number of possible open connections remained the same.

    [ ... deletia ... ]

> So far at least it is a totally win situation.  It would be interesting
> if some other people could give it a try and see what effect it has for
> them.  I imagine it will be more beneficial for small (read low budget)
> operations like mine, but you never know.  

    Ahh, okay.  Well, for those of us that were primarily sending only
articles smaller than 32KB to most of our peers anyway, this wouldn't make
that much of a difference for us.  But you were smart to keep the total
number of threads balanced when you broke out a separate "big" queue from
the "smaller" queue.

> I can't explain why, but it seems that the latency increases depending
> on the size of the message.  And no linearly either.

    That's a really good question.  I wish someone (with more knowledge of
how TCP/IP works than I have) would look at this closely and help us
figure out just what exactly is going on.

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>
    <http://wwwkeys.pgp.net:11371/pks/lookup?op=get&search=0xE38CCEF1>

Are you looking for a news feed from a site in the Freenix Top 130?
If so, contact me via private e-mail for details.

Re: Submitting to Freenix
#37058
Author: Brad Knowles
Date: Tue, 27 Apr 1999 00:00
38 lines
2496 bytes
In article <7g24e7$ckh$1@info.cs.uofs.edu>, bill@cs.uofs.edu (Bill
Gunshannon) wrote:

> Well, I promised to return with more info on the effects of splitting
> in a few days all my feeds into "big" and "small" feeds. (in case
> anyone here actually cares!!)  So here it is.  The amount of outgoing
> news from my Diablo box has more than doubled!!  That's right, more than
> twice as much of what I offer is now being accepted by my peers.

    Out of curiosity, what pivot points did you choose for "big" versus "small"?

> So then, now the big question.  Given the obvious improvement in 
> performance and the fact that it was immediately noticable, would
> this not be a good idea for USENET in general??

    If there were absolutely no side-effects, then yes I think this
probably would be a good idea for most folks to implement.

>                                                  I have seen no
> adverse side effects.  No increase in load.  No change in incoming
> news performance.  Only an increase in my ability to get news further
> down the pipe.

    Did you see an increase in the number of dnewslink processes that were
running?  Did you see an increase in the amount of memory that was being
used, versus how much was allocated for buffer cache?  What kinds of
choices did you make for default starting number of processes for the
"big" versus "small" queues, and how many processes did you let them build
up to as a maximum?

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>
    <http://wwwkeys.pgp.net:11371/pks/lookup?op=get&search=0xE38CCEF1>

Are you looking for a news feed from a site in the Freenix Top 130?
If so, contact me via private e-mail for details.

Re: Submitting to Freenix
#37075
Author: Bill Gunshannon
Date: Tue, 27 Apr 1999 00:00
104 lines
6121 bytes
In article <brad-2704991503430001@brad.techos.skynet.be>, brad@shub-internet.org (Brad Knowles) writes:
|> In article <7g24e7$ckh$1@info.cs.uofs.edu>, bill@cs.uofs.edu (Bill
|> Gunshannon) wrote:
|> 
|> > Well, I promised to return with more info on the effects of splitting
|> > in a few days all my feeds into "big" and "small" feeds. (in case
|> > anyone here actually cares!!)  So here it is.  The amount of outgoing
|> > news from my Diablo box has more than doubled!!  That's right, more than
|> > twice as much of what I offer is now being accepted by my peers.
|> 
|>     Out of curiosity, what pivot points did you choose for "big" versus "small"?

It varies depending on what the peer was taking from me in the first place.
(Obviously makes no sense to split at the 64K point if the peer doesn't take
anything over 48K)
Here's some examples:
      Max            Big                 Small
      No Limit       >64K                <64K
      No Limit       >48K                <48K   (This peer always seemed to have
                                                 more backlog than the one above.)
      16K            Only one queue
      No Limit       >64K                <64K    (This is my current norm.)
      64K            >32K                <32K
      256K           >48K                <48K
      1M             >40K                <40K
      1M             >64K                <64K    (This peer is always at max backlog.
                                                  Spliting queue resulted in 15 times
                                                  as many articles getting through
                                                  but backlog still remains.)

Nothing particularly scientific about it and I am sure with some tuning 
there are optimum settings.

|> 
|> > So then, now the big question.  Given the obvious improvement in 
|> > performance and the fact that it was immediately noticable, would
|> > this not be a good idea for USENET in general??
|> 
|>     If there were absolutely no side-effects, then yes I think this
|> probably would be a good idea for most folks to implement.

The only side-effect I have seen so far is a positive and not a negative.
My overall backlog has decreased.

|> 
|> >                                                  I have seen no
|> > adverse side effects.  No increase in load.  No change in incoming
|> > news performance.  Only an increase in my ability to get news further
|> > down the pipe.
|> 
|>     Did you see an increase in the number of dnewslink processes that were
|> running?  

Can't be.  I gave the "big" queue an entry of "n1" in my dnntpspool.ctl and
reduced the original "n" entry by one for the "small" queue.  So the max
number of possible open connections remained the same.  In actuality, I have
seen a large reduction in the number of dnewslink processes.  Because of the
constant state of backlog for most of my feeds they were always running with
the max number open.  Now, the "small" queue starts up, sends what it's got
and closes.  Thus for anytime other than at rollover time, the number is
smaller.

|>           Did you see an increase in the amount of memory that was being
|> used, versus how much was allocated for buffer cache?  

I really didn't look that close, but considering that I can never have more
processes running than I had before, I don't see how it could use more memory.
Most of the time it is probably using less because there are less processes.

|>                                                        What kinds of
|> choices did you make for default starting number of processes for the
|> "big" versus "small" queues, and how many processes did you let them build
|> up to as a maximum?

I allow 1-2 dnewslink for the "big" queue and 1-2 less than before for the 
"small" queue.  Maximum is the same as it always was.  Varies from a minimum
of 3 (1 big, 2 small) for one peer to a maximum of 5 (2 big, 3 small).
 
So far at least it is a totally win situation.  It would be interesting
if some other people could give it a try and see what effect it has for
them.  I imagine it will be more beneficial for small (read low budget)
operations like mine, but you never know.  

I can't explain why, but it seems that the latency increases depending
on the size of the message.  And no linearly either.  A quick look showed
that I have 12-17 times as many small messages as large messages and yet
I can push all of them through to most hosts in seconds where it takes
considerably longer to push the larger messages.  With the exception of
one peer (who takes a lot and is still perpetually backlogged) I am seeing
no backlog whatsoever on the "small" queues and no running backlog on the 
"big" queues.  This may defy logic (it seems like I am moving more data
in less time) but the facts are indisputable.  Who knows, maybe further
breakdowns can result in even better perormance.  I am sure with some
tuning the optimum configuration can be found.

bill

-- 
Bill Gunshannon          |  de-moc-ra-cy (di mok' ra see) n.  Three wolves
bill@cs.uofs.edu         |  and a sheep voting on what's for dinner.
University of Scranton   |
Scranton, Pennsylvania   |         #include <std.disclaimer.h>   

Re: Submitting to Freenix
#37080
Author: Russ Allbery
Date: Tue, 27 Apr 1999 00:00
30 lines
1792 bytes
nash <nash@rohan.sdsu.edu> writes:
> Bill Gunshannon (bill@cs.uofs.edu) wrote:

>> Well, I promised to return with more info on the effects of splitting
>> in a few days all my feeds into "big" and "small" feeds. (in case
>> anyone here actually cares!!)  So here it is.  The amount of outgoing
>> news from my Diablo box has more than doubled!!

> Is there a way to set up "big" and "small" feeds using innfeed?

Yup.  I do it for all of my outgoing feeds that include binaries.  Just
set up two feeds in newsfeeds to two separate innfeed processes that use
different configuration files:

# innfeed for small articles (<16KB) and large articles (>16KB).
innfeed-sm!:!*:Tc,Wnm*:/var/news/bin/startinnfeed -c innfeed-sm.conf
innfeed-lg!:!*:Tc,Wnm*:/var/news/bin/startinnfeed -c innfeed-lg.conf

and then for all of our outgoing feeds, split them into two two streams,
one for larger articles to innfeed-lg! and one for smaller articles to
innfeed-sm!.  Use the < and > flags in newsfeeds to control this.  For
example:

nntp-sm/nntp.stanford.edu:*:<16384,Ap,Tm:innfeed-sm!
nntp-lg/nntp.stanford.edu:*:>16383,Ap,Tm:innfeed-lg!

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

Re: Submitting to Freenix
#37088
Author: nash
Date: Tue, 27 Apr 1999 00:00
15 lines
1111 bytes
Bill Gunshannon (bill@cs.uofs.edu) wrote:
: Well, I promised to return with more info on the effects of splitting
: in a few days all my feeds into "big" and "small" feeds. (in case
: anyone here actually cares!!)  So here it is.  The amount of outgoing
: news from my Diablo box has more than doubled!!  

Is there a way to set up "big" and "small" feeds using innfeed?

--
     _ ___,;;;/  | Ron Nash (nash@sdsu.edu) San Diego State University
  ,;( )__, )~\|  | 
 ;; //   '--;    | Gin-N-Tonic   endurance horse
 '  ;\    |      | Luv on Fire   trusty trail horse

Re: Submitting to Freenix
#37093
Author: Arthur Hagen
Date: Wed, 28 Apr 1999 00:00
42 lines
2424 bytes
In article <ylaevtd7n7.fsf@windlord.stanford.edu>, Russ Allbery <rra@stanford.edu> writes:

> Yup.  I do it for all of my outgoing feeds that include binaries.  Just
> set up two feeds in newsfeeds to two separate innfeed processes that use
> different configuration files:
> 
> # innfeed for small articles (<16KB) and large articles (>16KB).
> innfeed-sm!:!*:Tc,Wnm*:/var/news/bin/startinnfeed -c innfeed-sm.conf
> innfeed-lg!:!*:Tc,Wnm*:/var/news/bin/startinnfeed -c innfeed-lg.conf
> 
> and then for all of our outgoing feeds, split them into two two streams,
> one for larger articles to innfeed-lg! and one for smaller articles to
> innfeed-sm!.  Use the < and > flags in newsfeeds to control this.  For
> example:
> 
> nntp-sm/nntp.stanford.edu:*:<16384,Ap,Tm:innfeed-sm!
> nntp-lg/nntp.stanford.edu:*:>16383,Ap,Tm:innfeed-lg!

Is there any advantage to setting up two different funnel feeds?

As long as they have different names in newsfeeds/innfeed.conf you
can feed them through the same funnel.  And since CPU use isn't
much of an issue with outgoing feeds, I think it would be faster
to use the same funnel feed?

There also seems to be a problem with splitting into more than two parts.
">" and "<" seems to get or'ed and not anded, so this won't work:

host-S:*:<8192,Tm:innfeed!
host-M:*:>8191,<65536,Tm:innfeed!
host-L:*:>65535,Tm:innfeed!

The middle entry will end up feeding everything, cause everything is
either smaller than 64k or larger or equal to 8k.
Any quick solutions for this?  Someone who knows the code well?

Regards,
-- 
*Art

Re: Submitting to Freenix
#37112
Author: barry (there is no barry)
Date: Wed, 28 Apr 1999 00:00
21 lines
1505 bytes
On Wed, 28 Apr 1999, Arthur Hagen wrote:

> Is there any advantage to setting up two different funnel feeds?
> As long as they have different names in newsfeeds/innfeed.conf you
> can feed them through the same funnel.  And since CPU use isn't
> much of an issue with outgoing feeds

It isn't?  It sure is when you start having a lot of outgoing
feeds...


> ">" and "<" seems to get or'ed and not anded, so this won't work:
> host-M:*:>8191,<65536,Tm:innfeed!
> 
> The middle entry will end up feeding everything, cause everything is
> either smaller than 64k or larger or equal to 8k.

Really?  I've never seen this problem...


Re: Submitting to Freenix
#37113
Author: Arthur Hagen
Date: Wed, 28 Apr 1999 00:00
39 lines
2513 bytes
In article <Pine.LNX.4.05.9904280839530.14775-100000@penguin.mendelu.cz>, "barry writes:
> On Wed, 28 Apr 1999, Arthur Hagen wrote:
> 
> > Is there any advantage to setting up two different funnel feeds?
> > As long as they have different names in newsfeeds/innfeed.conf you
> > can feed them through the same funnel.  And since CPU use isn't
> > much of an issue with outgoing feeds
> 
> It isn't?  It sure is when you start having a lot of outgoing
> feeds...

Most of the load I see here with a few feeds (3 full, about twice as
many partial feeds) is I/O-bound. With an average of about 20-25
outbound streams at all times, top reports 2-4% CPU use by innfeed on a
slow HP-UX box (and INND reports that 1.6% of the total time is "site
send", which I guess is the time for pushing the articles to innfeed in
the first place).  So if the I/O was up to it, I doubt it would be much
problem in running 50+ feeds on a relatively slow machine.
But of course, what you say is true, all depending on what you mean by
"a lot of", as well as the box itself.

> > ">" and "<" seems to get or'ed and not anded, so this won't work:
> > host-M:*:>8191,<65536,Tm:innfeed!
> > 
> > The middle entry will end up feeding everything, cause everything is
> > either smaller than 64k or larger or equal to 8k.
> 
> Really?  I've never seen this problem...

Unless others already have, I'll do a proper test of it, but when I
tried this, I suddenly offered the poor receiving site twice as many
articles as before, and got six times as many rejects..

Regards,
-- 
*Art

Re: Submitting to Freenix
#37127
Author: Arthur Hagen
Date: Wed, 28 Apr 1999 00:00
48 lines
1683 bytes
In article <7g5ica$m78$1@black.interact.net.au>, tom@black.interact.net.au writes:

> in your innfeed.conf:
> 
> peer asite {
> 	ip-name:		203.63.217.66
> 	max-connections:	2
> }
> peer asite-small {
> 	ip-name:		203.63.217.66
> 	max-connections:	2
> }

I've found out that I get better throughput (and ease administration) with:

group fastfeeds {
	// Small articles
	initial-connections:	2
	max-connections:	6
	peer host1-fast {
		ip-name:	host1.some.where
	}
	peer host2-fast {
		ip-name:	host2.some.where
	}
}

group slowfeeds {
	// Large articles
	initial-connections:	0
	max-connections:	2
	peer host1-slow {
		ip-name:	host1.some.where
	}
	peer host2-slow {
		ip-name:	host2.some.where
	}
}

It probably helps to explicitly set dynamic-method too, but that's
individual to each (sub)feed.

Regards,
-- 
*Art

Re: Submitting to Freenix
#37132
Author: Kjetil Torgrim Homme
Date: Wed, 28 Apr 1999 00:00
22 lines
1255 bytes
[tom minchin]

>   This is how I did it (probably not the best way, but it works).
>   
>   in your newsfeeds file something like this:
>   
>   # greater than 16kb articles
>   asite/asite\
>   	:*\
>   	:>16000,Tm:innfeed!
>   # less than 16kb articles
>   asite-small/asite\
>   	:*\
>   	:<16000,Tm:innfeed!

Ooops.  What happens to articles which are exactly 16000 bytes large?
Write "<16001" instead.


Kjetil T.

Re: Submitting to Freenix
#37134
Author: tom minchin
Date: Wed, 28 Apr 1999 00:00
30 lines
1157 bytes
nash@rohan.sdsu.edu (nash) writes:
>Is there a way to set up "big" and "small" feeds using innfeed?

This is how I did it (probably not the best way, but it works).

in your newsfeeds file something like this:

# greater than 16kb articles
asite/asite\
	:*\
	:>16000,Tm:innfeed!
# less than 16kb articles
asite-small/asite\
	:*\
	:<16000,Tm:innfeed!

in your innfeed.conf:

peer asite {
	ip-name:		203.63.217.66
	max-connections:	2
}
peer asite-small {
	ip-name:		203.63.217.66
	max-connections:	2
}

tom@interact.net.au

Re: Submitting to Freenix
#37160
Author: barry (there is no barry)
Date: Wed, 28 Apr 1999 00:00
60 lines
3861 bytes
On Tue, 27 Apr 1999, Brad Knowles wrote:

> > I can't explain why, but it seems that the latency increases depending
> > on the size of the message.  And no linearly either.
> 
>     That's a really good question.  I wish someone (with more knowledge of
> how TCP/IP works than I have) would look at this closely and help us
> figure out just what exactly is going on.

Bah, there's a lot more than TCP/IP to think about.  These are
sites that are heavily backlogged, no?  Presumably running INN
and writing to a conventional spool?

More things to consider, the size of the receiving buffer, or
how much data is available to innd on each cycle of the select
loop.  If the peer is receiving both small and large articles
simultaneously over multiple connections and is backlogged, it
will have channels where several small articles are waiting to
be written to the spool during the time it takes to get each
of several parts of the larger articles by the select loop.
Those articles being written are going to slow down reception
of the larger articles.

Look at your peer's stats, if they are available, to see where
that peer is bogged down.  It's probably in the writes to the
spool, with no idle time.  If not, then you are seeing some
other problem, perhaps network-related (some horrible awful
disgusting misconfiguration of a switch, or perhaps a network
with so bad packet loss so that while the smaller articles can
get in without too many retries, the larger ones hit too many
potholes), or perhaps a spool that is a bit too optimized for
writing of lots of smaller articles but falls behind when
writing the increasing amount of larger data -- often you see
one optimize for writing lots of small scattered files, which
also works well for reading back the larger articles, kinda
matching the distribution of articles vs. readership.

What you might see when the small article backlogs go away is
that the larger articles go a bit more quickly.  In fact, if
you are the sole feeder to that site and you only queue the
smaller articles, I bet you'll see the larger articles going
at a few per second or so, while when they are competing with
the smaller articles, it takes many seconds to minutes to get
the larger ones delivered.

At this point, I'd say that TCP/IP is unlikely to play much of
a role (but you do want to increase the receive buffer size),
with the physical spool I/O affecting transfer rates far more.
And if your peer is operating at 100% capacity, you'll have to
expect to see some stuff being thrown away.

Nevertheless, by separating the articles to a poorly-performing
peer, you can prioritize the more important hierarchies, and the
smaller articles, and also give a best-shot feed of what remains
so that the articles we care most about for Usenet don't fall
by the wayside.  And best of all, your Freenix Rankness will go
up (as mine falls they way it should)


Re: Submitting to Freenix
#37154
Author: Kjetil Torgrim Homme
Date: Thu, 29 Apr 1999 00:00
33 lines
1898 bytes
[Arthur Hagen]

>   > > ">" and "<" seems to get or'ed and not anded, so this won't work:
>   > > host-M:*:>8191,<65536,Tm:innfeed!
>   > > 
>   > > The middle entry will end up feeding everything, cause
>   > > everything is either smaller than 64k or larger or equal to
>   > > 8k.
>   > 
>   > Really?  I've never seen this problem...
>   
>   Unless others already have, I'll do a proper test of it, but when
>   I tried this, I suddenly offered the poor receiving site twice as
>   many articles as before, and got six times as many rejects..

Why test when you can read the code? (innd/art.c)

        if (sp->MaxSize && Data->SizeValue > sp->MaxSize)
            /* Too big for the site. */
            continue;

        if (sp->MinSize && Data->SizeValue < sp->MinSize)
            /* Too small for the site. */
            continue;

('<' sets MaxSize, '>' sets MinSize.)

It should work.


Kjetil T.

Re: Submitting to Freenix
#37159
Author: Arthur Hagen
Date: Thu, 29 Apr 1999 00:00
29 lines
1896 bytes
In article <1rn1zskmwo.fsf@haey.ifi.uio.no>, Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> writes:

> Why test when you can read the code? (innd/art.c)
> 
>         if (sp->MaxSize && Data->SizeValue > sp->MaxSize)
>             /* Too big for the site. */
>             continue;
> 
>         if (sp->MinSize && Data->SizeValue < sp->MinSize)
>             /* Too small for the site. */
>             continue;
> 
> ('<' sets MaxSize, '>' sets MinSize.)
> 
> It should work.

Depending on operator precedence is a tricky thing with some compilers,
especially if you turn on too much optimization.  It sure it easy for
an aggressive but brain dead optimizer to find out that sp->MaxSize &&
Data->SizeValue is constant between the two...
So I'll test it out, despite the source really looking like it
*should* work, as I've seen even stranger behaviour.

Regards,
-- 
*Art

Re: Submitting to Freenix
#38202
Author: T. William Wells
Date: Wed, 23 Jun 1999 00:00
27 lines
2080 bytes
In article <ylemj3axr0.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
: Making the channel more intelligent about what it's reading could
: potentially result in some major speedups in this area, but would be
: fairly grody to code.  The Right Solution is to make innd threaded and
: allocate a new thread for each incoming connection, so that thread can
: just read whatever comes and not worry about having to give fair share of
: its time to other connections.

Or even better, give up the idea of a monolithic innd. Instead,
have a collection of daemons, each devoted to a particular part of
the "job". Incoming connections would get their own nntpd, which
would talk to historyd, actived, and newsfeedd (for outgoing).
Nnrpds would also use those daemons. This would resolve hosts of
problems, save gobs of RAM, all for the cost of a little IPC. Each
individual part would be immensely simpler than their present-day
counterparts. There would also end up an API for each, allowing
for replaceable components.

And, done right, it also scales nicely -- you could scatter things
among various machines so as to limit the load on any given
machine.

Then again, such a radical change would mean that it's not INN
anymore....

Re: Submitting to Freenix
#38204
Author: Bill Gunshannon
Date: Wed, 23 Jun 1999 00:00
54 lines
3539 bytes
In article <ylemj3axr0.fsf@windlord.stanford.edu>, Russ Allbery <rra@stanford.edu> writes:
|> Fairly old thread on why splitting outgoing feeds into a large article
|> feed and a small article feed produces such a dramatic increase in
|> performance.  Sorry to resurrect really old threads; Gnus's caching has a
|> tendency to encourage me to do that more than I probably should.
|> 
|> Bill Gunshannon <bill@cs.uofs.edu> writes:
|> 
|> > I can't explain why, but it seems that the latency increases depending
|> > on the size of the message.  And no linearly either.  A quick look
|> > showed that I have 12-17 times as many small messages as large messages
|> > and yet I can push all of them through to most hosts in seconds where it
|> > takes considerably longer to push the larger messages.
|> 
|> Reading the innd source code produces some very interesting tidbits.  I'm
|> willing to bet that this has something to do with it (innd/chan.c):

<INN source deleted!!>

|> I don't think large articles get the correct proportional share of INN's
|> time because the underlying channel code isn't aware of whether you're
|> receiving articles or receiving commands and therefore only reads a little
|> to avoid getting too many commands at a time.
|> 
|> Making the channel more intelligent about what it's reading could
|> potentially result in some major speedups in this area, but would be
|> fairly grody to code.  The Right Solution is to make innd threaded and
|> allocate a new thread for each incoming connection, so that thread can
|> just read whatever comes and not worry about having to give fair share of
|> its time to other connections.
|> 
|> Operating systems are really good at scheduling things.  Whenever
|> possible, it's best to let the operating system do it and not try to do it
|> yourself.

An interesting exposition, with only one minor problem.  It doesn't
explain my situation as I am not running INN but rather diablo.  
Unfortunately, I am not able to tell what real effect it has as for
some reason my stats to Freenix don't appear to have been included.
I don not know if there was some problem with the data or if it just
never arrived.  I CC:ed myself as well and the data looks valid to me,
but I could be wrong.  And so, I ask again, is there anyone at Freenix
that I can contact to verify that my data actually arrived or if it was
somehow flawed??

bill

-- 
Bill Gunshannon          |  de-moc-ra-cy (di mok' ra see) n.  Three wolves
bill@cs.uofs.edu         |  and a sheep voting on what's for dinner.
University of Scranton   |
Scranton, Pennsylvania   |         #include <std.disclaimer.h>   

Re: Submitting to Freenix
#38218
Author: Russ Allbery
Date: Wed, 23 Jun 1999 00:00
25 lines
1861 bytes
T William Wells <bill@twwells.com> writes:
> Russ Allbery  <rra@stanford.edu> wrote:

>> Making the channel more intelligent about what it's reading could
>> potentially result in some major speedups in this area, but would be
>> fairly grody to code.  The Right Solution is to make innd threaded and
>> allocate a new thread for each incoming connection, so that thread can
>> just read whatever comes and not worry about having to give fair share
>> of its time to other connections.

> Or even better, give up the idea of a monolithic innd. Instead, have a
> collection of daemons, each devoted to a particular part of the
> "job". Incoming connections would get their own nntpd, which would talk
> to historyd, actived, and newsfeedd (for outgoing).

That's threads, except hellishly slower.  If we're going to do all that
work, we may as well do it in a way that's as fast as possible.  And in
order to really do the above, you have to use something like shared memory
(like Diablo), and I haven't seen any indication that shared memory is
that much more portable than threads are.

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

Re: Submitting to Freenix
#38223
Author: Russ Allbery
Date: Wed, 23 Jun 1999 00:00
53 lines
3323 bytes
Fairly old thread on why splitting outgoing feeds into a large article
feed and a small article feed produces such a dramatic increase in
performance.  Sorry to resurrect really old threads; Gnus's caching has a
tendency to encourage me to do that more than I probably should.

Bill Gunshannon <bill@cs.uofs.edu> writes:

> I can't explain why, but it seems that the latency increases depending
> on the size of the message.  And no linearly either.  A quick look
> showed that I have 12-17 times as many small messages as large messages
> and yet I can push all of them through to most hosts in seconds where it
> takes considerably longer to push the larger messages.

Reading the innd source code produces some very interesting tidbits.  I'm
willing to bet that this has something to do with it (innd/chan.c):

    /* Read in whatever is there, up to some reasonable limit. */
    /*
     * XXX We really want to limit the amount of time it takes to
     * process the incoming data for this channel.  But there's
     * no easy way of doing that, so we restrict the data size instead.
     * If the data is part of a single large article, then reading
     * and processing many kilobytes at a time costs very little.
     * If the data is a long list of CHECK commands from a streaming
     * feed, then every line of data will require a history lookup, and
     * we probably don't want to do more than about 10 of those per
     * channel on each cycle of the main select() loop (otherwise we
     * might take too long before giving other channels a turn).  10
     * lines of CHECK commands suggests a limit of about 1 kilobyte of
     * data, or less.  BUFSIZ is often about 1 kilobyte, and is
     * attractive for other reasons, so let's use that as our size limit.
     */

I don't think large articles get the correct proportional share of INN's
time because the underlying channel code isn't aware of whether you're
receiving articles or receiving commands and therefore only reads a little
to avoid getting too many commands at a time.

Making the channel more intelligent about what it's reading could
potentially result in some major speedups in this area, but would be
fairly grody to code.  The Right Solution is to make innd threaded and
allocate a new thread for each incoming connection, so that thread can
just read whatever comes and not worry about having to give fair share of
its time to other connections.

Operating systems are really good at scheduling things.  Whenever
possible, it's best to let the operating system do it and not try to do it
yourself.

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

Re: Submitting to Freenix
#38225
Author: Bill Gunshannon
Date: Wed, 23 Jun 1999 00:00
27 lines
2141 bytes
In article <yln1xr9ggt.fsf@windlord.stanford.edu>, Russ Allbery <rra@stanford.edu> writes:
|> Bill Gunshannon <bill@cs.uofs.edu> writes:
|> 
|> > An interesting exposition, with only one minor problem.  It doesn't
|> > explain my situation as I am not running INN but rather diablo.
|> 
|> It's affecting your peers, who are running all sorts of things.  Some
|> other servers may also have similar problems; I don't know.  But the
|> problem is with receiving articles, not sending them.

Well, I have to admit I have noticed for a long time that my peers
running INN have more problems keeping up than my peers running
other packages, but when I changed to big/small queues the improvement
was equal across the board.  I don't doubt that INN might handle 
articles differently depending on size (either on purpose or as an
unwanted side-effect) but although I haven't determined the reason yet,
there does still seem to be something more to it.

bill

-- 
Bill Gunshannon          |  de-moc-ra-cy (di mok' ra see) n.  Three wolves
bill@cs.uofs.edu         |  and a sheep voting on what's for dinner.
University of Scranton   |
Scranton, Pennsylvania   |         #include <std.disclaimer.h>   

Re: Submitting to Freenix
#38230
Author: Russ Allbery
Date: Wed, 23 Jun 1999 00:00
13 lines
1141 bytes
Bill Gunshannon <bill@cs.uofs.edu> writes:

> An interesting exposition, with only one minor problem.  It doesn't
> explain my situation as I am not running INN but rather diablo.

It's affecting your peers, who are running all sorts of things.  Some
other servers may also have similar problems; I don't know.  But the
problem is with receiving articles, not sending them.

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

Re: Submitting to Freenix
#38242
Author: Russ Allbery
Date: Thu, 24 Jun 1999 00:00
60 lines
3456 bytes
T William Wells <bill@twwells.com> writes:
> Russ Allbery  <rra@stanford.edu> wrote:
>> T William Wells <bill@twwells.com> writes:

>>> Or even better, give up the idea of a monolithic innd. Instead, have a
>>> collection of daemons, each devoted to a particular part of the
>>> "job". Incoming connections would get their own nntpd, which would
>>> talk to historyd, actived, and newsfeedd (for outgoing).

>> That's threads, except hellishly slower.

> I don't think it'd be that much slower. Most of the "action" would still
> take place within each process (or thread).

Except you're going to have to context-switch constantly, which is
expensive and is definitely going to add to your latency.  And the IPC
will be even worse.  I'm willing to bet that INN as it is currently
written will have a better latency than such a scheme.

Diablo already does something like this; I believe Matt's said in the past
that he doesn't really care about getting the last bit of latency and that
his process model isn't really designed for it.

INN currently works fairly well as it stands; if I didn't care about
getting the last bit of latency (mostly just because I think it would be
an interesting challenge), I'd leave the architecture alone.  It's
fundamentally sound.

> "Portable" is my requirement. I'd have no objection to a system that can
> be implemented as either threads or processes but I'd really object to
> one that relied on threads.

By the time anyone finishes a rework of INN to use either processes or
threads, threads are going to be pretty much as portable as other stuff
that INN already relies on (like mmap), possibly more so.  There are
already POSIX pthreads implementations on all nine Unix platforms we
support here at Stanford.

> Be that as it may, a good design would abstract out the shared data and
> the multi-processing stuff, so it could be implemented on a variety of
> platforms.

That's a good ideal.  There are some edge cases that are going to be
tricky.  Doing an orderly shutdown of the entire system, for one.

In any event, adding threading to INN is something that I do intend to
work on over the next couple of years, provided it remains interesting to
me.  Even for people who aren't interested in threads, some nice stuff
should fall out of that work; for one thing, it would necessitate making
INN's internal APIs as thread-safe as possible and abstracting out more
code into libraries so that I don't have to rewrite all the parts of INN
that currently would work fine with threads.

But there are other things to work on first.  :)  Right now, I'm thinking
we may be able to retire subst completely by INN 2.3.

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

Re: Submitting to Freenix
#38243
Author: T. William Wells
Date: Thu, 24 Jun 1999 00:00
32 lines
2115 bytes
In article <ylogi6qrhj.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
: > Or even better, give up the idea of a monolithic innd. Instead, have a
: > collection of daemons, each devoted to a particular part of the
: > "job". Incoming connections would get their own nntpd, which would talk
: > to historyd, actived, and newsfeedd (for outgoing).
:
: That's threads, except hellishly slower.

I don't think it'd be that much slower. Most of the "action" would
still take place within each process (or thread).

: If we're going to do all that
: work, we may as well do it in a way that's as fast as possible.

"Portable" is my requirement. I'd have no objection to a system
that can be implemented as either threads or processes but I'd
really object to one that relied on threads.

: And in
: order to really do the above, you have to use something like shared memory
: (like Diablo), and I haven't seen any indication that shared memory is
: that much more portable than threads are.

SysV shared memory is fairly portable. But it's ugly. For my
applications, I've just used UDP sockets and it works well enough.

Be that as it may, a good design would abstract out the shared
data and the multi-processing stuff, so it could be implemented on
a variety of platforms.

Re: Submitting to Freenix
#38249
Author: Chris Sedore
Date: Fri, 25 Jun 1999 00:00
39 lines
2244 bytes
Curt Welch wrote in message <19990625154537.574$FY@newsreader.com>...
>"Chris Sedore" <cmsedore@maxwell.syr.edu> wrote:
>> Threads are not the only possibility:  async IO can provide an
>> alternative design methodology.
>
>True.  I've never heard of async (disk) I/O however.


The aio routines are descriptor type neutral.  The implementation details
matter here, but in FreeBSD's case, the aio calls do work as advertised for
both disk and socket io.  FreeBSD creates aio daemons which attach to your
process to execute each aio operation.

>> I've been playing with a transit engine running on FreeBSD that is single
>> threaded and uses aio routines ...
>
>Looking on a FreeBSD box I couldn't find any async I/O routines.  Could
>you give me some pointers (man pages? lib names? etc.)?  Do you know what
>version of FreeBSD they showed up on?


They are in 3.x, but they have a number of limitations.  For 4.x they are
improved, but there are still limits on how useful they are for sockets.
"man aio_read" should work on 3.x or 4.x.  Someone has written pages on all
the aio functions for 4.x, but last I looked they weren't in the 4.x
snapshots.  I've done some work enhancing the aio_read/write for sockets
which is free for the asking.  I hope to get it committed to the source
tree.

You can also look here:

http://www.opengroup.org/public/pubs/online/7908799/xsh/aio_read.html

-Chris



Re: Submitting to Freenix
#38251
Author: Curt Welch
Date: Fri, 25 Jun 1999 00:00
11 lines
1344 bytes
"Chris Sedore" <cmsedore@maxwell.syr.edu> wrote:

> "man aio_read" should work on 3.x or 4.x.

Aha yes.  It's on 3.1 but not 3.0.  Thanks I'll play with that...

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/

Re: Submitting to Freenix
#38253
Author: Curt Welch
Date: Fri, 25 Jun 1999 00:00
76 lines
5248 bytes
Russ Allbery <rra@stanford.edu> wrote:
> I got a 17% improvement out of INN's Perl filters just by not doing a
> needless copy of the article.  Using IPC to talk to another daemon is
> *two* needless copies, through kernel space no less.  Now you can
> duplicate the same effect in shared memory, but between shared memory and
> threads I'd really rather write threads.

I've written a news server which is somwhat like innd in that it's a big
process which is select loop based.  Currently, it even handles all the
reader processes in the main processes.  But I've intended to split off
various parts in other deamons processes.  Right now, the only thing split
off is the article I/O.  I have separate processes for sets of cycbuf-like
spool files.  The spool daemons are also select loop design and can handled
multiple requests over NNTP like TCP/IP streams.

With this design, you get the article disk reads out of the main process
select loop (which would kill it since you can't select on a disk read),
and turn them into TCP/IP reads which you can select on.  It also makes it
very natural to distribute those spool deamons over multiple machines.

But, as you guys are saying, you end up having to do multiple extra
copies of the articles.  And that does eat up a lot more cpu time (at least
twice as much).  But because it's split across multiple processes you can
take advantage of SMP machines.  But it doesn't add (much) latency when
feeding because the main process does the feeding as well as the receiving.
And it doesn't wait for the article to be saved to the spool deamon before
feeding it - it just feeds it from the in-core copy.  And because it's all
one process it was easy to support multiple outgoing streams for a feed
(and multiple outgoing streams to a single remote spool as well).  When
articles need to be sent to a remote host they are just assigned to the
stream with the smalest backlog.

The tricky part of the design is keeping the main select loops running
quickly. You have to play lots of games to make sure nothing you dom't hang
the loop for two long becasue it kills the performance of everything.  And
as pointed out in this thread, you basically end up writing scheduling
software to figure out what to do next and how long to do it -- stuff you
would really like the OS to be dealing with instead of the application.

But the basic design (multiple selelct loop processes talking to each other
over TCP/IP connections) is nice in the fact that it should be very easy
to port to a wide range of Unix platforms.  It uses no threads or shared
memory, or shard disk files.  All IPC is though TCP/IP streams.  And you
can move any of the deamons to remote machines.

The next thing to split out of the main process is reader support.  I'm not
sure if I'm going to do this, but I could.  I'd create a reader deamon
which could support a few hundred connections each.  They would talk to
both the main process to get active/history information and the spool
deamons to get the articles.  They would do no disk I/O.  This would be
required to handle a very large concurrent user base because the main
process is kept busy enough receiving articles.  A heavy user load on the
main process would really slow down it's ability to receive articles
quickly.

Overview is something I've still not solved.  I'm doing it the slow way
right now by generating it on demand and caching it in-core.  But that's
both too slow on the initial fetch and unworkable for a larger reader base
(in-core cache would not be large enough).  I might end up creating a
seperate overview deamon which manages it's own overview database to deal
with this.

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

So, basicaly, the design is multiple large innd-like select loop processes
each acting (to some extent) as database servers.  They each manage their
own part of the news database.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/

Re: Submitting to Freenix
#38260
Author: Curt Welch
Date: Fri, 25 Jun 1999 00:00
18 lines
1604 bytes
"Chris Sedore" <cmsedore@maxwell.syr.edu> wrote:
> Threads are not the only possibility:  async IO can provide an
> alternative design methodology.

True.  I've never heard of async (disk) I/O however.

> I've been playing with a transit engine running on FreeBSD that is single
> threaded and uses aio routines ...

Looking on a FreeBSD box I couldn't find any async I/O routines.  Could
you give me some pointers (man pages? lib names? etc.)?  Do you know what
version of FreeBSD they showed up on?

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/

Re: Submitting to Freenix
#38261
Author: Joe Greco
Date: Fri, 25 Jun 1999 00:00
75 lines
4678 bytes
In news.software.nntp article <yl3dzg28yw.fsf@windlord.stanford.edu>, Russ Allbery <rra@stanford.edu> wrote:
:T William Wells <bill@twwells.com> writes:
:> Russ Allbery  <rra@stanford.edu> wrote:
:>> T William Wells <bill@twwells.com> writes:
:
:>>> Or even better, give up the idea of a monolithic innd. Instead, have a
:>>> collection of daemons, each devoted to a particular part of the
:>>> "job". Incoming connections would get their own nntpd, which would
:>>> talk to historyd, actived, and newsfeedd (for outgoing).

Gosh, that sounds like something I outlined a few years back.  ;-)

:>> That's threads, except hellishly slower.
:
:> I don't think it'd be that much slower. Most of the "action" would still
:> take place within each process (or thread).
:
:Except you're going to have to context-switch constantly, which is
:expensive and is definitely going to add to your latency.  And the IPC
:will be even worse.  I'm willing to bet that INN as it is currently
:written will have a better latency than such a scheme.

I'm willing to bet otherwise, unless INN has suddenly become radically
different than in the days of 1.4*.  INN essentially causes I/O streams
to sleep while it is busy doing other things (like serving other streams
and waiting on disk I/O).  This performs poorly on a single-CPU system,
and sucks rocks on a SMP system where your other CPU could be doing
something useful like accepting data, but isn't.

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.

:Diablo already does something like this; I believe Matt's said in the past
:that he doesn't really care about getting the last bit of latency and that
:his process model isn't really designed for it.

What "isn't designed for it" is the outbound feeding system in Diablo.  The
inbound is fantastic for handling incoming news...  or, at least, I can't
point out any inefficiencies.

Diablo's outbound feeding strategy loses because, unlike Cyclone or a lot
of other transmission utilities, only one stream per feed object is sent
in "real time".  Something like Cyclone (or innfeed I believe) will let
you associate one feed object with several output streams, lowering the
latency by multiplexing articles among the available streams.  In addition,
INN feeds articles to a monolithic innfeed via IPC (and Cyclone presumably
queues data for a thread) which is a neatly select()'able operation.  
Diablo uses whatever facility the OS may have available to do the 
equivalent of a "tail -f", and you may have a hundred processes each 
reading their own individual batch file in this manner.  In addition, to 
get realtime performance, one must fflush() the output stream which 
results in a write-per-article to the batch file for _each_ feed.  I
guess I shouldn't bitch about that, I wrote that code.  Heh.

So Diablo really suffers a lot more on outbound.  Doing anything about
it is difficult, though.  Rewriting the Diablo output code to be more
INN-ish has been on my mind, which would allow one to use a feed system
like innfeed.

Realistically, though, the context switching isn't a problem.  My two-
CPU Diablo boxes do a thousand per second with enough spare CPU to run
RC5 at 90% of one CPU.  I get twice as many interrupts per second as I
do cxw's.

... JG

Re: Submitting to Freenix
#38262
Author: Russ Allbery
Date: Fri, 25 Jun 1999 00:00
71 lines
4349 bytes
Joe Greco <jgreco@ns.sol.net> writes:

> I'm willing to bet otherwise, unless INN has suddenly become radically
> different than in the days of 1.4*.  INN essentially causes I/O streams
> to sleep while it is busy doing other things (like serving other streams
> and waiting on disk I/O).  This performs poorly on a single-CPU system,
> and sucks rocks on a SMP system where your other CPU could be doing
> something useful like accepting data, but isn't.

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.

What multiple processes aren't going to help with is *latency*, except
possibly in the case of a large number of large articles (and splitting
your incoming feeds will fix that for small articles, although large
articles are still going to be slow).  And doing those context switches is
going to hurt your latency for small articles fairly badly, I think.

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

I've never seen innd without tons of main loop idle time.  I don't think
I've seen it drop below 40% idle even when it's taking in 75 articles a
second.  Maybe on traditional spool, but then your disk effects are
dominating, not your TCP reads.

>> Diablo already does something like this; I believe Matt's said in the
>> past that he doesn't really care about getting the last bit of latency
>> and that his process model isn't really designed for it.

> What "isn't designed for it" is the outbound feeding system in Diablo.
> The inbound is fantastic for handling incoming news...  or, at least, I
> can't point out any inefficiencies.

Well, yeah, but you need both.  Latency is how fast you can turn articles
around.  Both INN and Diablo suffer from the fact that they're doing IPC
and context switching to get an article out the door.  INN is also writing
the article to disk and then reading it back in again, which really sucks.

For a really fast transit server, you want innfeed running as a thread
inside innd, which then just hands it a buffer that it blats out to all
your peers at the same time that another thread is writing it out to disk.

> Realistically, though, the context switching isn't a problem.  My two-
> CPU Diablo boxes do a thousand per second with enough spare CPU to run
> RC5 at 90% of one CPU.  I get twice as many interrupts per second as I
> do cxw's.

It's not just the context switches; it's sharing data.  Threading innd by
itself is going to improve matters, but probably not drastically.
Threading innfeed, ditto.  But once they're both threaded, there's no
reason not to just run them as the same process, and then transit becomes
*blazingly* fast.

I got a 17% improvement out of INN's Perl filters just by not doing a
needless copy of the article.  Using IPC to talk to another daemon is
*two* needless copies, through kernel space no less.  Now you can
duplicate the same effect in shared memory, but between shared memory and
threads I'd really rather write threads.

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

Re: Submitting to Freenix
#38264
Author: greg andruk
Date: Fri, 25 Jun 1999 00:00
7 lines
920 bytes
T William Wells <bill@twwells.com> writes:

> INN does not rely on mmap.

It does now.

Re: Submitting to Freenix
#38266
Author: Chris Sedore
Date: Fri, 25 Jun 1999 00:00
86 lines
5328 bytes
[somewhat trimmed]
Joe Greco wrote in message <3773780d$0$374@news.execpc.com>...
>In news.software.nntp article <ylg13gyawh.fsf@windlord.stanford.edu>, Russ
Allbery <rra@stanford.edu> wrote:
>:Joe Greco <jgreco@ns.sol.net> writes:
>:> I'm willing to bet otherwise, unless INN has suddenly become radically
>:> different than in the days of 1.4*.  INN essentially causes I/O streams
>:> to sleep while it is busy doing other things (like serving other streams
>:> and waiting on disk I/O).  This performs poorly on a single-CPU system,
>:> and sucks rocks on a SMP system where your other CPU could be doing
>:> something useful like accepting data, but isn't.
>:
>: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.
>
>In my experience, that's not true...  and I ran things like MD5-based
>article storage and CNFS before most of the rest of the world had even
>heard of them.  This is, of course, not with current revisions, but my
>experiences did do a great job of pointing out architectural flaws (and
>innd-timer was part of all that).
>
>First off, I will (of course) immediately concede that a good design
>with real threads would beat either Diablo or INN quite easily.


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

I've been playing with a transit engine running on FreeBSD that is single
threaded and uses aio routines (which are also standardized and appearing
widely in Unix implementations, though I've tweaked this one from stock
sources and added at least one thing not in the standard to make up for
missing real-time signals in FreeBSD).  It doesn't have trouble with IO on
incoming feeds (the outgoing feeds take about 45 seconds to pick up, so they
haven't yet kicked in--unfortunately most backlogs don't last long enough to
see how it fairs when both are running flat out) :

           input        (Total)           output
   packets  errs      bytes    packets  errs      bytes colls
      1809     0    3257897        891     0      98597     0
      1924     0    4075061        930     0     227497     0
      2233     0    2264377       1109     0     138921     0
      3197     0    2987793       1598     0      98647     0
      1485     0    2261637        791     0      91590     0
      1887     0    6675199        920     0     190608     0
      1634     0    9529512        849     0     206752     0
      4689     0    8909461       2170     0     239357     0
     12466     0    9499728       4987     0     193668     0
      6421     0    9778203       2483     0     180523     0
      6521     0   10294603       2277     0     200523     0
      6886     0    7840352       2567     0     177535     0
      5354     0    2766388       2107     0     125505     0
      2059     0    2919413       1035     0     111776     0
      1981     0    2185197        992     0     109553     0
      1488     0    2624960        779     0      85456     0
      1912     0    3740051        935     0     165187     0
      2562     0    3440910       1201     0     157444     0
      2470     0    4002023       1252     0     159650     0

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.

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

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.

-Chris



Re: Submitting to Freenix
#38267
Author: T. William Wells
Date: Fri, 25 Jun 1999 00:00
10 lines
1188 bytes
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.

Re: Submitting to Freenix
#38269
Author: Joe Greco
Date: Fri, 25 Jun 1999 00:00
156 lines
9187 bytes
In news.software.nntp article <ylg13gyawh.fsf@windlord.stanford.edu>, Russ Allbery <rra@stanford.edu> wrote:
:Joe Greco <jgreco@ns.sol.net> writes:
:> I'm willing to bet otherwise, unless INN has suddenly become radically
:> different than in the days of 1.4*.  INN essentially causes I/O streams
:> to sleep while it is busy doing other things (like serving other streams
:> and waiting on disk I/O).  This performs poorly on a single-CPU system,
:> and sucks rocks on a SMP system where your other CPU could be doing
:> something useful like accepting data, but isn't.
:
: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.

In my experience, that's not true...  and I ran things like MD5-based
article storage and CNFS before most of the rest of the world had even
heard of them.  This is, of course, not with current revisions, but my
experiences did do a great job of pointing out architectural flaws (and
innd-timer was part of all that).

First off, I will (of course) immediately concede that a good design
with real threads would beat either Diablo or INN quite easily.

I still feel that a model like INN's, for incoming news, is inadequate
particularly for large-scale applications.  It is simply unable to take
advantage of multiple CPU's, and unable to provide for things such as
disk I/O concurrency - instead replacing that with _blocking_ (even if
just for a few hundredths of a second) while writing an article.

This probably isn't interesting for your average site with three or
four feeds, but in my experience is a bad thing when you've got two
hundred inbound connections active to fifty peers.

:What multiple processes aren't going to help with is *latency*, except
:possibly in the case of a large number of large articles (and splitting
:your incoming feeds will fix that for small articles, although large
:articles are still going to be slow).  And doing those context switches is
:going to hurt your latency for small articles fairly badly, I think.

Let's see.  I'm handling an average of ten articles per second.  The
machine in question can do ten thousand cxw per second.  I would tend
to think that the disk write (at a few milliseconds) would kill you
worse than a cxw that takes well under a millisecond.  Let's talk
about how to eliminate/optimize that disk write instead.  ;-)

:> 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.
:
:I've never seen innd without tons of main loop idle time.  I don't think
:I've seen it drop below 40% idle even when it's taking in 75 articles a
:second.  Maybe on traditional spool, but then your disk effects are
:dominating, not your TCP reads.

Irrelevant.  The "disk effects" are causing the whole thing to suck...
remember, the OS has a limited amount of TCP buffer, so every time it
fills while INN is off doing something else (serving another stream,
writing to disk, etc) that feed stalls until the select loop hits that
thread and reads that data.

In _my_ experience, I've rarely seen an innd with 40% idle.  Again,
that is with inn1.4* and things like CNFS or MD5.  I'm pleased to hear
it if things are better today, but regardless, you can still max out
a current INN by either flooding it with connections or putting a real
slow (i.e. substantially less than what you need) disk subsystem on it.
A Diablo under the same load should fare much better.

:>> Diablo already does something like this; I believe Matt's said in the
:>> past that he doesn't really care about getting the last bit of latency
:>> and that his process model isn't really designed for it.
:
:> What "isn't designed for it" is the outbound feeding system in Diablo.
:> The inbound is fantastic for handling incoming news...  or, at least, I
:> can't point out any inefficiencies.
:
:Well, yeah, but you need both.  Latency is how fast you can turn articles
:around.

You are welcome to discuss how the whole car sucks.  I guess I don't care.
I'm pleased that the engine works well even if the rest of the car does
not work well.  I like rebuilding cars and the engine is important to me.
With a good engine, I have a shot at building a car you approve of.

:Both INN and Diablo suffer from the fact that they're doing IPC
:and context switching to get an article out the door.  INN is also writing
:the article to disk and then reading it back in again, which really sucks.

Diablo is too.  I think we are in violent agreement here.  ;-)

:For a really fast transit server, you want innfeed running as a thread
:inside innd, which then just hands it a buffer that it blats out to all
:your peers at the same time that another thread is writing it out to disk.

Yup.  We are in violent agreement here.  But then you have Cyclone, not
INN.

:> Realistically, though, the context switching isn't a problem.  My two-
:> CPU Diablo boxes do a thousand per second with enough spare CPU to run
:> RC5 at 90% of one CPU.  I get twice as many interrupts per second as I
:> do cxw's.
:
:It's not just the context switches; it's sharing data.  Threading innd by
:itself is going to improve matters, but probably not drastically.
:Threading innfeed, ditto.  But once they're both threaded, there's no
:reason not to just run them as the same process, and then transit becomes
:*blazingly* fast.

Again, I agree.  However, I feel that Diablo _today_ provides a better
inbound news handling capability than INN _today_ does - and this is
simply an architectural matter, because Diablo today is closer to that
threaded model we'd both like to see.  It has multiple processes that
handle peers and write data, all independently, and therefore makes
good use of an SMP system in the same manner as a threaded news system.
The fact that it uses heavyweight processes to do this means that there
is some waste, but given a really busy transit server with lots of
connections, my money is on Diablo.  For now.

:I got a 17% improvement out of INN's Perl filters just by not doing a
:needless copy of the article.  Using IPC to talk to another daemon is
:*two* needless copies, through kernel space no less.  Now you can
:duplicate the same effect in shared memory, but between shared memory and
:threads I'd really rather write threads.

This is a bit of an apples/oranges comparison.  You shouldn't really use
IPC to move entire articles around...  we've all seen that this sucks 
from the nice filter API provided by Cyclone (which I coded into Diablo).
I don't think IPC is too bad if you're planning on using it to provide
minimal amounts of information, and it is a very well-tested and very
portable technology - unlike threads and to a lesser extent shared
memory.

Now, would I pay to see it all replaced with a threaded solution?  Of
course I would.  But it'd have to be real (kernel) threads, not some
userland thread library that simply wraps all calls to be non-blocking
I/O but is still in reality just a single single-threaded process - 
which is unable to use SMP effectively.  We are coming into an age
where most UNIX variants either support this or will support it soon.

The INN you are describing, a few years down the road, does sound very
appealing, and very much like the Cyclone of today.  If and when it
happens, I'll certainly be among the first to consider switching back
and dumping development time into INN again.  Until that is imminent,
though, I've just got too little faith in the architecture of INN,
and would rather use an architecture that can scale better even if it
is only half as efficient as a threaded model could be.

You don't know how many times I've thought about going off in a corner
and writing my own news transit engine...

... JG

Re: Submitting to Freenix
#38270
Author: T. William Wells
Date: Fri, 25 Jun 1999 00:00
69 lines
3701 bytes
In article <yl3dzg28yw.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
: T William Wells <bill@twwells.com> writes:
: > I don't think it'd be that much slower. Most of the "action" would still
: > take place within each process (or thread).
:
: Except you're going to have to context-switch constantly, which is
: expensive and is definitely going to add to your latency.

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.

Ultimately, you can't get rid of the delays -- what you can do is
arrange things so that whenever one part of the system delays,
other parts can take over. The present innd design doesn't allow
that, since the delays processing one input prevent return to the
main loop. A threaded implementation, or a multi-process
implementation, can avoid this problem.

: And the IPC
: will be even worse.

No reason it should be -- in-memory IPC is also going to be
measured in microseconds. It'll take a lot of such things before
they add up to meaningful delays. And given that spreading the
tasks means that one can skip *other* delays, I think it's a win.

: I'm willing to bet that INN as it is currently
: written will have a better latency than such a scheme.

I rather doubt that. INN's primary loop is stuck with delays that
tend to involve disk accesses. For example, no matter how you
slice it, a file create is going to delay the process and that
delay is going to be equivalent to quite a few context switches
indeed.

: By the time anyone finishes a rework of INN to use either processes or
: threads, threads are going to be pretty much as portable as other stuff
: that INN already relies on (like mmap), possibly more so.

INN does not rely on mmap. It can *use* mmap if it's available and
works. But there are still buggy implementations of mmap out
there.... I suspect that'll be the state of affairs regarding
threads, for a long time.

: > Be that as it may, a good design would abstract out the shared data and
: > the multi-processing stuff, so it could be implemented on a variety of
: > platforms.
:
: That's a good ideal.  There are some edge cases that are going to be
: tricky.  Doing an orderly shutdown of the entire system, for one.

True. You'd want to have, as part of the API, a means to say
"don't initiate anything you don't have to". Configuration changes
are another icky kettle of fish.

: But there are other things to work on first.  :)

whispered: (overview)

:)

Re: Submitting to Freenix
#38271
Author: greg andruk
Date: Sat, 26 Jun 1999 00:00
29 lines
1919 bytes
T William Wells <bill@twwells.com> writes:

> In article <879097x1a4.fsf@slip-32-101-212-91.ma.us.ibm.net>,
> greg andruk  <meowing@banet.net> wrote:
>> T William Wells <bill@twwells.com> writes:
>> 
>> > INN does not rely on mmap.
>> 
>> It does now.

> Then I think I shall switch to C news. I don't trust *any* mmap
> implementation.

That's actually not a bad starting point for the kind of thing you're
talking about.  Dig up the daemon mode patch to the performance
release -- it's got to be applied by hand to CR, but it only takes an
hour or two to figure out where to put stuff -- and you've got the
beginnings of a nice filer module.  I think that patch is out on
ftp.std.com in something like src/news.  It breaks CR's NOV
implementation, but you probably wouldn't want to keep the batched
mkov anyway.

Oh yeah -- there's one tweak you've got to make it you use that patch.
CR's relaynews gets and stores the date when it starts, and you'll get
article-in-future errors after it's been running a while if you don't
make it update somewhere.


Re: Asychronous I/O (was: Submitting to Freenix)
#38272
Author: Chris Sedore
Date: Sat, 26 Jun 1999 00:00
33 lines
2218 bytes
Russ Allbery wrote in message ...
>Joe Greco <jgreco@ns.sol.net> writes:
>
>> This is interesting.  I wonder how it would fare in an SMP environment.
>> FreeBSD's SMP support has some drawbacks (can you say "big giant lock")
>> and I suspect aio is subject to this.  However, it is at least a step in
>> a useful direction, and opens up the floor to speculation about how it
>> would compare to a threaded model.
>
>Does anyone know if there are plans of adding this to Linux and Solaris?
>Linux's SMP environment is pretty good as of the latest 2.3, from what
>I've heard, and Solaris's should be quite solid.


Solaris 7 has the aio routines.  I've been working (to the extent time
allows) to make the code run on Solaris.  Solaris has a more complete
implementation, so the code needs more abstraction in the core io loop, and
then there are the BSD vs SYS V details (didn't quite realize how much
BSDisms had taken over in my head :).

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.

-Chris



Re: News server architecture (was: Submitting to Freenix)
#38273
Author: Russ Allbery
Date: Sat, 26 Jun 1999 00:00
211 lines
11401 bytes
Changing the subject to something more appropriate....

Joe Greco <jgreco@ns.sol.net> writes:

> In my experience, that's not true...  and I ran things like MD5-based
> article storage and CNFS before most of the rest of the world had even
> heard of them.  This is, of course, not with current revisions, but my
> experiences did do a great job of pointing out architectural flaws (and
> innd-timer was part of all that).

Speaking of which, the timer is one of the main things that I'm worried
about losing in a threaded design, just because it's so *incredibly*
useful.  It'll need a redesign to cope with threads, though, and I'm not
sure of the best architecture for it....

But thank you for that.  It's one of the single best features of INN, and
routinely makes people working on other (non-Usenet) pieces of large
server software extremely envious.  My colleagues who are working on LDAP
servers would *love* to have something similar.

> First off, I will (of course) immediately concede that a good design
> with real threads would beat either Diablo or INN quite easily.

*nod*  I think that's pretty obvious to everyone at this point, for
transit.  I think it's a lot less obvious for readers; I still am of the
opinion that a forking nnrpd is going to be comparable in speed to a
threaded nnrpd for most purposes.

(And yes, this is a partial reversal of my previous attitude towards
threads.  Working with them and thinking through threaded designs some
more has taught me the error of my previous ways.)

> I still feel that a model like INN's, for incoming news, is inadequate
> particularly for large-scale applications.  It is simply unable to take
> advantage of multiple CPU's, and unable to provide for things such as
> disk I/O concurrency - instead replacing that with _blocking_ (even if
> just for a few hundredths of a second) while writing an article.

Yeah, this is true.  Multiple CPUs aren't particularly interesting to me
personally (I'm just not likely to be able to scrouge multi-CPU boxes for
news, plus news really isn't CPU-bound), but not being able to take
advantage of disk I/O concurrency is a catastrophy in some configurations.

headwall.stanford.edu, for example, is connected to an array of 30 2GB
disk drives and is theoretically capable of writing to some large number
(possibly all; I haven't checked out the specs on an SSA recently) of
those disks simultaneously.  INN definitely isn't taking advantage of
this.  (On the other hand, article write is definitely *not* the
bottleneck for that server; the Perl filter is the major one, because it's
only a SPARC 20, and most of the rest of the time is spent in writing to
the history file.)

> This probably isn't interesting for your average site with three or four
> feeds, but in my experience is a bad thing when you've got two hundred
> inbound connections active to fifty peers.

Granted.  Writeback cache for your disks can help there, though.

> Let's see.  I'm handling an average of ten articles per second.  The
> machine in question can do ten thousand cxw per second.  I would tend to
> think that the disk write (at a few milliseconds) would kill you worse
> than a cxw that takes well under a millisecond.  Let's talk about how to
> eliminate/optimize that disk write instead.  ;-)

Oh, yes, granted, the real gain comes from avoiding the disk write.  I
have no disagreement with that.  My argument is that when comparing INN
with Diablo, both of which do the disk write, the context switches are
more of a factor.  But I also admit that I'm looking at things from an INN
perspective, and Diablo has made a lot of other good decisions that give
it more ability to take advantage of hardware concurrency than INN.

> Irrelevant.  The "disk effects" are causing the whole thing to suck...
> remember, the OS has a limited amount of TCP buffer, so every time it
> fills while INN is off doing something else (serving another stream,
> writing to disk, etc) that feed stalls until the select loop hits that
> thread and reads that data.

Except that if you have to do the disk write, you have to do the disk
write, and if the disk write is dominating your performance, it's going to
be doing so whether you're running in multiple processes or just in one.
You can't keep accepting articles you can't write out to disk, so you have
to slow down the whole system to the speed of the disk writes.

The advantage you get from multiple processes doing the writes is that if
your I/O system can handle concurrency, the disk writes go faster.  And
I'll grant that.

> In _my_ experience, I've rarely seen an innd with 40% idle.  Again, that
> is with inn1.4* and things like CNFS or MD5.  I'm pleased to hear it if
> things are better today,

It's not entirely clear how much better they are, since I don't have a lot
of experience outside of my own to draw on and I give my news servers the
kind of hardware that they need.  :)  (Which isn't the same as just
dumping lots of money into them; I tend to be able to do quite well on
cast-off hardware these days since everyone's doing to 9GB disk drives and
news servers, particularly for transit, *really* like *lots* of 2GB
disks.)

I also don't store or propagate a full binary feed.  Never have, never
will.  It's a waste of resources.  So that alters the picture a great
deal, I do understand, as lots of large binaries are a very different load
pattern from lots of small articles.  And ISPs don't have the luxury I
have to put their feet down and say no.

> but regardless, you can still max out a current INN by either flooding
> it with connections or putting a real slow (i.e. substantially less than
> what you need) disk subsystem on it.  A Diablo under the same load
> should fare much better.

Disk subsystem, I'll grant.  I've heard tales of Diablo forking itself to
death with a large number of incoming connections, which certainly isn't
going to happen to INN (sans readers).

> You are welcome to discuss how the whole car sucks.  I guess I don't
> care.  I'm pleased that the engine works well even if the rest of the
> car does not work well.  I like rebuilding cars and the engine is
> important to me.  With a good engine, I have a shot at building a car
> you approve of.

Oh, yeah, I grant that.  It's really hard to compare servers on individual
points when the easy performance numbers to get are for the whole thing
and each server takes radically different approaches with veyr different
tradeoffs.

>> For a really fast transit server, you want innfeed running as a thread
>> inside innd, which then just hands it a buffer that it blats out to all
>> your peers at the same time that another thread is writing it out to
>> disk.

> Yup.  We are in violent agreement here.  But then you have Cyclone, not
> INN.

Well, yes and no.  You can still do UUCP, you can still do regular news
batches, you still have an embedded Perl filter, it's still free
software....  :)

I'll take your word for it, having never run Cyclone.  I don't have any
idea what its internal structure is like, apart from the fact that it
obviously uses threads.  But I'd say it's immediately obvious to anyone
who's ever worked on news software that as soon as you have threads, you
stop doing a write between taking an article in and sending it out.

> Again, I agree.  However, I feel that Diablo _today_ provides a better
> inbound news handling capability than INN _today_ does - and this is
> simply an architectural matter, because Diablo today is closer to that
> threaded model we'd both like to see.  It has multiple processes that
> handle peers and write data, all independently, and therefore makes good
> use of an SMP system in the same manner as a threaded news system.

Okay, I'll grant that.

I suppose to some degree that argues that I should go spend my time
working on Diablo because it's already closer to the architecture that I
think we're going to end up with.  I guess I just have a soft spot in my
heart for INN; I've run it for years and years, I understand it, I know
how it's laid out, and I like how parts of it work.

> This is a bit of an apples/oranges comparison.  You shouldn't really use
> IPC to move entire articles around...  we've all seen that this sucks
> from the nice filter API provided by Cyclone (which I coded into
> Diablo).

Heh.  :)  I remember when people were trying to tell me that IPC was just
fine for spam filters and that INN wasn't getting any real advantages from
having the filter embedded.

> I don't think IPC is too bad if you're planning on using it to provide
> minimal amounts of information, and it is a very well-tested and very
> portable technology - unlike threads and to a lesser extent shared
> memory.

This is certainly true.

I'm thinking more and more about the argument that any redesign of INN's
architecture should abstract out those communication pieces so that one
can plug in threading, shared memory, UDP sockets with multiple processes,
or whatever else you want.  I don't know how hard that would be to do, but
it does sound very nice.

> Now, would I pay to see it all replaced with a threaded solution?  Of
> course I would.  But it'd have to be real (kernel) threads, not some
> userland thread library that simply wraps all calls to be non-blocking
> I/O but is still in reality just a single single-threaded process

Well, sure.

> The INN you are describing, a few years down the road, does sound very
> appealing, and very much like the Cyclone of today.  If and when it
> happens, I'll certainly be among the first to consider switching back
> and dumping development time into INN again.  Until that is imminent,
> though, I've just got too little faith in the architecture of INN, and
> would rather use an architecture that can scale better even if it is
> only half as efficient as a threaded model could be.

Fair enough.  :)

> You don't know how many times I've thought about going off in a corner
> and writing my own news transit engine...

I guess that's what I'm talking about doing, just starting with INN.  But
like I said, this is something I plan on working on over the next few
years; there are other things that need to happen to INN first.  The
source base has accumulated years worth of dirt here and there and needs a
good cleaning, the conversion to autoconf needs to be finished, and the
documentation could stand some major improvements.

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

Re: News server architecture (was: Submitting to Freenix)
#38274
Author: sukey1
Date: Sat, 26 Jun 1999 00:00
26 lines
1818 bytes
Russ Allbery wrote in message ...
>T William Wells <bill@twwells.com> writes:
>> 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.
>
>Really?  I don't know a lot about the tradeoffs there; I thought the major
>performance headache with streams is the connection setup/teardown, so if
>you have a long-lasting connection it was mostly as fast as UDP.  But I
>admit to really not knowing much about this at all and would be happy to
>have someone educate me.


We have a happy bunch of users with UDP
sukey1
News across space means more space across your service




Asychronous I/O (was: Submitting to Freenix)
#38275
Author: Russ Allbery
Date: Sat, 26 Jun 1999 00:00
16 lines
1362 bytes
Joe Greco <jgreco@ns.sol.net> writes:

> This is interesting.  I wonder how it would fare in an SMP environment.
> FreeBSD's SMP support has some drawbacks (can you say "big giant lock")
> and I suspect aio is subject to this.  However, it is at least a step in
> a useful direction, and opens up the floor to speculation about how it
> would compare to a threaded model.

Does anyone know if there are plans of adding this to Linux and Solaris?
Linux's SMP environment is pretty good as of the latest 2.3, from what
I've heard, and Solaris's should be quite solid.

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

News server architecture (was: Submitting to Freenix)
#38276
Author: Russ Allbery
Date: Sat, 26 Jun 1999 00:00
29 lines
2159 bytes
Chris Sedore <cmsedore@maxwell.syr.edu> writes:

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

I believe threads under Linux are currently implemented as separate
processes that share their address spaces, which is close enough to true
kernel threads for me.  (My primary development platform is Solaris, which
certainly has real POSIX kernel threads; it even has a multithreaded
kernel.)

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

Would it make any difference to use poll() on OSes where that's supported?

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

Re: Submitting to Freenix
#38277
Author: Joe Greco
Date: Sat, 26 Jun 1999 00:00
49 lines
3484 bytes
In news.software.nntp article <9303290311991906734-1@dp-news.maxwell.syr.edu>, "Chris Sedore" <cmsedore@maxwell.syr.edu> wrote:
:[somewhat trimmed]
:Joe Greco wrote in message <3773780d$0$374@news.execpc.com>...
:>In news.software.nntp article <ylg13gyawh.fsf@windlord.stanford.edu>, Russ
:Allbery <rra@stanford.edu> wrote:
:>:Joe Greco <jgreco@ns.sol.net> writes:
:>:> I'm willing to bet otherwise, unless INN has suddenly become radically
:>:> different than in the days of 1.4*.  INN essentially causes I/O streams
:>:> to sleep while it is busy doing other things (like serving other streams
:>:> and waiting on disk I/O).  This performs poorly on a single-CPU system,
:>:> and sucks rocks on a SMP system where your other CPU could be doing
:>:> something useful like accepting data, but isn't.
:>:
:>: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.
:>
:>In my experience, that's not true...  and I ran things like MD5-based
:>article storage and CNFS before most of the rest of the world had even
:>heard of them.  This is, of course, not with current revisions, but my
:>experiences did do a great job of pointing out architectural flaws (and
:>innd-timer was part of all that).
:>
:>First off, I will (of course) immediately concede that a good design
:>with real threads would beat either Diablo or INN quite easily.
:
:Threads are not the only possibility:  async IO can provide an alternative
:design methodology.
:
:I've been playing with a transit engine running on FreeBSD that is single
:threaded and uses aio routines (which are also standardized and appearing
:widely in Unix implementations, though I've tweaked this one from stock
:sources and added at least one thing not in the standard to make up for
:missing real-time signals in FreeBSD).  It doesn't have trouble with IO on
:incoming feeds (the outgoing feeds take about 45 seconds to pick up, so they
:haven't yet kicked in--unfortunately most backlogs don't last long enough to
:see how it fairs when both are running flat out) :

This is interesting.  I wonder how it would fare in an SMP environment.
FreeBSD's SMP support has some drawbacks (can you say "big giant lock")
and I suspect aio is subject to this.  However, it is at least a step in
a useful direction, and opens up the floor to speculation about how it
would compare to a threaded model.

... JG

News server architecture (was: Submitting to Freenix)
#38278
Author: Russ Allbery
Date: Sat, 26 Jun 1999 00:00
41 lines
2742 bytes
Curt Welch <curt@kcwc.com> writes:

> But the basic design (multiple selelct loop processes talking to each
> other over TCP/IP connections) is nice in the fact that it should be
> very easy to port to a wide range of Unix platforms.  It uses no threads
> or shared memory, or shard disk files.  All IPC is though TCP/IP
> streams.  And you can move any of the deamons to remote machines.

Yeah, this is a really good point.

It used to be that one of the major advantages of INN over nearly anything
else was that it was insanely portable; unfortunately, the latest 2.3
stuff really does *require* a working mmap() implementation, which blows
some holes in that.  I think we might be able to get some of it back (a
library interface to the active file would be nice and could take care of
some of that).

> Overview is something I've still not solved.  I'm doing it the slow way
> right now by generating it on demand and caching it in-core.  But that's
> both too slow on the initial fetch and unworkable for a larger reader
> base (in-core cache would not be large enough).  I might end up creating
> a seperate overview deamon which manages it's own overview database to
> deal with this.

Overview is a really interesting hard problem.

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

Yeah, that's my opinion too.  I'm not sure you even want to split it into
a separate thread.  Queuing history lookups and processing them from a
queue doesn't sound to me to be as nice of an architecture as just
wrapping the history lookups in a mutex, and you may even be able to get
more concurrency than just a mutex around the whole thing.

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

News server architecture (was: Submitting to Freenix)
#38280
Author: Russ Allbery
Date: Sat, 26 Jun 1999 00:00
20 lines
1493 bytes
T William Wells <bill@twwells.com> writes:
> 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.

Really?  I don't know a lot about the tradeoffs there; I thought the major
performance headache with streams is the connection setup/teardown, so if
you have a long-lasting connection it was mostly as fast as UDP.  But I
admit to really not knowing much about this at all and would be happy to
have someone educate me.

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

News server architecture (was: Submitting to Freenix)
#38281
Author: Russ Allbery
Date: Sat, 26 Jun 1999 00:00
59 lines
3110 bytes
T William Wells <bill@twwells.com> writes:

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

The big difference between a context switch between threads and a context
switch between processes isn't really the kernel entry/exit; threads have
been implemented as full kernel processes on a lot of architectures and
still have a significant speedup.  The difference is that you don't have
to do a TLB flush.

Now admittedly because people have been doing separate processes a lot
more than separate threads, a lot of hard work has gone into making TLB
flushes fast.  You all have convinced me that I'm considering this to be
more significant than it probably is.

> Ultimately, you can't get rid of the delays -- what you can do is
> arrange things so that whenever one part of the system delays, other
> parts can take over. The present innd design doesn't allow that, since
> the delays processing one input prevent return to the main loop. A
> threaded implementation, or a multi-process implementation, can avoid
> this problem.

True.

> INN does not rely on mmap.

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.

> It can *use* mmap if it's available and works. But there are still buggy
> implementations of mmap out there.... I suspect that'll be the state of
> affairs regarding threads, for a long time.

Quite probably; the Highwind folks have been blazing the trail there for
us some and discovering what platforms really don't have working thread
implementations.  :)

> True. You'd want to have, as part of the API, a means to say "don't
> initiate anything you don't have to". Configuration changes are another
> icky kettle of fish.

Yeah.

> whispered: (overview)
> :)

That's looking a *lot* better.  But the same batch of patches that fixed
that caused us to depend on mmap().

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

Re: News server architecture (was: Submitting to Freenix)
#38285
Author: T. William Wells
Date: Sat, 26 Jun 1999 00:00
28 lines
1870 bytes
In article <ylogi3s8qs.fsf_-_@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
: > INN does not rely on mmap.
:
: 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....

: > whispered: (overview)
: > :)
:
: That's looking a *lot* better.  But the same batch of patches that fixed
: that caused us to depend on 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*.

Ya know, one of the things that would clearly have helped INN at
certain points, is code reviews....

Re: Submitting to Freenix
#38287
Author: T. William Wells
Date: Sat, 26 Jun 1999 00:00
12 lines
1093 bytes
In article <879097x1a4.fsf@slip-32-101-212-91.ma.us.ibm.net>,
greg andruk  <meowing@banet.net> wrote:
: T William Wells <bill@twwells.com> writes:
:
: > INN does not rely on mmap.
:
: It does now.

Then I think I shall switch to C news. I don't trust *any* mmap
implementation.

Re: Submitting to Freenix
#38288
Author: Chris Sedore
Date: Sat, 26 Jun 1999 00:00
22 lines
1524 bytes
Joe Greco wrote in message <3774636e$0$374@news.execpc.com>...
>
>This is interesting.  I wonder how it would fare in an SMP environment.
>FreeBSD's SMP support has some drawbacks (can you say "big giant lock")
>and I suspect aio is subject to this.  However, it is at least a step in
>a useful direction, and opens up the floor to speculation about how it
>would compare to a threaded model.


The Giant Kernel Lock (GKL) is something of a barrier.  We've run the code
here on a dual processor box and it works.  Can't say that we needed the
extra CPU resources, so I'm not sure if I could say that it improved things.

More work on the aio routines might enhance this picture wrt the GKL if one
was willing to tolerate FreeBSD specific APIs or API enhancements.

-Chris



Re: News server architecture (was: Submitting to Freenix)
#38290
Author: T. William Wells
Date: Sat, 26 Jun 1999 00:00
31 lines
2287 bytes
In article <ylr9mzs91f.fsf_-_@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
: T William Wells <bill@twwells.com> writes:
: > 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.
:
: Really?  I don't know a lot about the tradeoffs there; I thought the major
: performance headache with streams is the connection setup/teardown, so if
: you have a long-lasting connection it was mostly as fast as UDP.  But I
: admit to really not knowing much about this at all and would be happy to
: have someone educate me.

"Mostly". But TCP has flow control and error recovery which,
especially on a single machine, just get in the way. In the
implementation I did, I used UDP and it worked without any
hassles. *And*, I got to handle errors my way instead of the TCP
way. E.g., on receiving articles, if I didn't get a response back
quickly enoguh, I just said fukit and accepted the article anyway,
figuring that later stages of the process would dump the thing.

(What I had was a message ID daemon, that kept an in-memory hash
of recently received messages and only went to the history file if
the message ID wasn't in memory.)

Re: News server architecture (was: Submitting to Freenix)
#38292
Author: T. William Wells
Date: Sun, 27 Jun 1999 00:00
38 lines
2269 bytes
In article <ylhfnukpwz.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
: T William Wells <bill@twwells.com> writes:
: > 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.

Yeah. If nothing else, I have an actived that will get info from
the active file and I think that there's at least one other.

: For what it's worth, I know quite a few people are running 2.3 on FreeBSD
: without difficulties.

If you say so.... I'd like to hear that from the horse's mouth,
though; I've been told before that mmap() works on FreeBSD and
found that it didn't.

: > Ya know, one of the things that would clearly have helped INN at certain
: > points, is code reviews....
:
: Well, 2.3 is a development release.  Making forward progress is more
: important in some cases that making sure everything that goes into the
: tree is perfect.

I'm not sure I agree. Broken code costs an *immense* amount of
lost time all over the net. It pays to get it right the first
time....

: We can always fix stuff later; getting in the overview
: fixes was extremely important.

You won't hear me disagreeing with that!

Re: News server architecture (was: Submitting to Freenix)
#38294
Author: Russ Allbery
Date: Sun, 27 Jun 1999 00:00
39 lines
2296 bytes
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.

For what it's worth, I know quite a few people are running 2.3 on FreeBSD
without difficulties.

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

> Ya know, one of the things that would clearly have helped INN at certain
> points, is code reviews....

Well, 2.3 is a development release.  Making forward progress is more
important in some cases that making sure everything that goes into the
tree is perfect.  We can always fix stuff later; getting in the overview
fixes was extremely important.

In any case, feedback on what people think is important helps.  :)

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

Page 1 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