🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
7 messages
7 total messages Started by Mark Hittinger Tue, 21 Jan 1997 00:00
caveat - multiple feeds to slaves
#14300
Author: Mark Hittinger
Date: Tue, 21 Jan 1997 00:00
30 lines
1406 bytes
I do multiple feeds to the slaves here.  Its either have larger backlogs
and nearly perfect fifo overviews or have no backlogs and not-in-order
overviews.

Overview can be sorted with 'sort -n' to make it acceptable to "less tolerant
readers(tm)" :-).

The other problem that we see here is one of the feeds gets ahead of another
to the same target slave - so there is a gap in the articles on the spool
of the slave, i.e.

news/software/nntp/100001
news/software/nntp/100002
news/software/nntp/100005

In very short order the other feed will fill in #100003 and #100004.  
Unfortunately there is a brief window where someone using a "less tolerant
reader(tm)" will see #100005 as the high water mark and miss the slightly
delayed articles.

I like the "." delay idea :-)

Later

Mark Hittinger
Netcom/Dallas
bugs@freebsd.netcom.com

Re: caveat - multiple feeds to slaves
#14262
Author: Joe Greco
Date: Tue, 21 Jan 1997 00:00
70 lines
3440 bytes
In article <5c3biu$qs4@dfw-ixnews11.ix.netcom.com>,
Mark Hittinger <bugs@freebsd.netcom.com> wrote:
>I do multiple feeds to the slaves here.  Its either have larger backlogs
>and nearly perfect fifo overviews or have no backlogs and not-in-order
>overviews.

This sounds like something I've been working on.

>Overview can be sorted with 'sort -n' to make it acceptable to "less tolerant
>readers(tm)" :-).

Huh?

The only consumer of the overview database files (at least in NNTP) is: 
nnrpd.  (Well, also expireover, but...)

nnrpd goes to great lengths to ALWAYS provide overview data to a client
that requests it, using any existing ".overview" as a "cache" of already-
generated overview data.

In particular, the NOV code does a linear search forward through the 
.overview file, caching the current location.  It will become very much
less efficient - but still work - if it can not find the data in the
.overview file, because it will open the ARTICLE and generate the data.
But in no case that I have seen will it cause a client to stop 
functioning, because nnrpd always returns the data, one way or another.

(I just rewrote all the NNRP NOV code yet again today, so I am particularly
familiar with it)...

What I did:  I worked on the assumption that nonsequential delivery was a
likely given - many times over.  Inside nnrpd, I preprocess the data, 
essentially trading a full up front traversal of the .overview file (that 
allows me to very efficiently index the data by message number), on the 
assumption that once in a large group, one was likely to ask for many 
articles.

It seems to be working okay, although the load averages on the machines
seem nearly double, performance is still excellent and I have not seen
any of the nasty side effects I have traditionally associated with a bunch
of clients grinding on the spool to manually generate NOV data.

You might be able to do the same thing by constantly sorting your files,
but that's a lot of work, and doesn't happen in real time.

What I haven't done: looked at expireover to see how to make that play
ball.

>The other problem that we see here is one of the feeds gets ahead of another
>to the same target slave - so there is a gap in the articles on the spool
>of the slave, i.e.
>
>news/software/nntp/100001
>news/software/nntp/100002
>news/software/nntp/100005
>
>In very short order the other feed will fill in #100003 and #100004.  
>Unfortunately there is a brief window where someone using a "less tolerant
>reader(tm)" will see #100005 as the high water mark and miss the slightly
>delayed articles.
>
>I like the "." delay idea :-)

I have a brilliant idea for that too, but I won't share it until I either
have working code or a smoking heap of rubble.

... JG

Re: caveat - multiple feeds to slaves
#14320
Author: Steve Jones
Date: Wed, 22 Jan 1997 00:00
109 lines
6096 bytes
Please pardon if I come across as overly critical, I don't mean to be.

In article <5c4483$bg0@earth.alpha.net>, Joe Greco <jgreco@ns.sol.net> wrote:
>In article <5c3biu$qs4@dfw-ixnews11.ix.netcom.com>,
>Mark Hittinger <bugs@freebsd.netcom.com> wrote:
>>I do multiple feeds to the slaves here.  Its either have larger backlogs
>>and nearly perfect fifo overviews or have no backlogs and not-in-order
>>overviews.
>
>This sounds like something I've been working on.
>
>>Overview can be sorted with 'sort -n' to make it acceptable to "less tolerant
>>readers(tm)" :-).
>
>Huh?

If the overchan program were to keep track of the last article number 
in a newsgroup, it could detect when it is given data for a lesser 
article number.  It could then instead of appending the overview 
record, rewrite the file with the new overview record inserted in the 
proper order.  If an index of the overview file is kept in another 
file, the rewrite can be done rather efficiently.  (Assumes that 
the operation of opening the index file is not overly resource intensive.)  

>The only consumer of the overview database files (at least in NNTP) is: 
>nnrpd.  (Well, also expireover, but...)
>
>nnrpd goes to great lengths to ALWAYS provide overview data to a client
>that requests it, using any existing ".overview" as a "cache" of already-
>generated overview data.
>
>In particular, the NOV code does a linear search forward through the 
>.overview file, caching the current location.  It will become very much
>less efficient - but still work - if it can not find the data in the
>.overview file, because it will open the ARTICLE and generate the data.
>But in no case that I have seen will it cause a client to stop 
>functioning, because nnrpd always returns the data, one way or another.
>
>(I just rewrote all the NNRP NOV code yet again today, so I am particularly
>familiar with it)...

>What I did:  I worked on the assumption that nonsequential delivery was a
>likely given - many times over.  Inside nnrpd, I preprocess the data, 
>essentially trading a full up front traversal of the .overview file (that 
>allows me to very efficiently index the data by message number), on the 
>assumption that once in a large group, one was likely to ask for many 
>articles.

If the overchan program did the indexing for you, for example keeping
an .overview-index file, you'd have files you could memory map for
efficiencies sake.  The memory savings you get from using a memory mapped
file would be significant. (Remember to release old file versions
regularly.)  Saving memory on a virtual memory system is equivalent to
saving paging I/O and if you don't page, your system throughput will
improve accordingly.

>It seems to be working okay, although the load averages on the machines
>seem nearly double, performance is still excellent and I have not seen
>any of the nasty side effects I have traditionally associated with a bunch
>of clients grinding on the spool to manually generate NOV data.
>
>You might be able to do the same thing by constantly sorting your files,
>but that's a lot of work, and doesn't happen in real time.

By "real time" I assume you mean on demand by the clients.  Processing
that can be done ahead of the demand is an improvement in service, and
the further ahead the better.  If you can do the processing that 
you've given to nnrpd occur in overchan, your clients will have 
further improved response.  If you can avoid "read" operations on the 
overchan file, and avoid the memory requirement for a read buffer (and
it sounds like you've buffered the entire file by your comments above)
you will have better performance.  

>What I haven't done: looked at expireover to see how to make that play
>ball.

I've also hacked on nnrpd to do a few things, but what I found was 
that my improved version didn't have a sufficiently significant impact
on client responsiveness that maintaining my own version of the code 
would be worthwhile.  The code I did was along the lines of what you 
described, but didn't buffer all of the data at once.  I was 
particularly concerned about requests for overview data in reverse 
record order.  

I've found that for my site, the times when the slave falls behind in 
it's single feed is when there are an excessive number of new files 
being added to an already large directory.  The filesystem I am using 
(ultrix BSD fast filesystem) does a poor job of that.  I found that if
I filtered out the articles from the sites with the most postings to 
"misc.jobs" (each of the thousands of articles posted weeky are on the
senders' WWW sites in a more convenient form) my newsfeed backlogging 
went way.
 
Not coincidentally, the peak in news flow during the day can coincide 
with the peak in client activity.  For news servers which have become 
resource constrainted, it can come down to a choice of whether the 
client can have the news "current" or "now".  I think that for the 
most part, clients will demand both.  Any efficiencies that can be 
gained in either the processing of incoming news or the serving of 
articles to the clients will benefit both activities.  I applaud your
efforts, but find myself favoring the "now" camp.  
-- 
--
  Steven Jones
  Computing & Communications 354843,  University of Washington
  E-mail:  noyd@u.washington.edu    Phone:  (206) 543-5852

Re: caveat - multiple feeds to slaves
#14322
Author: Joe Greco
Date: Wed, 22 Jan 1997 00:00
33 lines
2122 bytes
In article <5c6f6s$i1g$1@imperator.oops.sub.de>,
Sven Paulus <sven@oops.sub.de> wrote:
>Joe Greco <jgreco@ns.sol.net> wrote:
> JG> Yes, potentially.  I considered a number of alternatives that involved
> JG> "fixing" overchan, but I was rather skeptical that any method that would
> JG> require rewriting the whole file would be practical
>
>How about taking nntpcacheds approach: splitting overview into multiple
>files, each containing overview information for about 50 articles and having
>filenames like over.view-low#-hi#. Rewriting these won't be too difficult.

Major code changes required to do so, not just one file for one program.

Probably worse performance for XHDR type commands, as you now have to
deal with multiple files (think: directory search/locate time on a very
busy NOV partition.  Once you have an open file desc, you don't worry
about that anymore).

If you are going to make fundamental changes, why not make changes that 
are the highest performance possible?

There is _no_ benefit that I can think of that this buys, that a good
indexing system would not address better.

I'll say this again, I do not think there is any one ideal solution.
But when possible and practical I prefer "least intrusive" solutions to
problems.  If someone wants to totally re-engineer NOV, I have some
"brilliant" ideas that I'd be happy to discuss.

... JG

Re: caveat - multiple feeds to slaves
#14324
Author: Joe Greco
Date: Wed, 22 Jan 1997 00:00
235 lines
11973 bytes
In article <5c5pd1$5fk@nntp1.u.washington.edu>,
Steve Jones <noyd@u.washington.edu> wrote:
>Please pardon if I come across as overly critical, I don't mean to be.

:-)  I always enjoy a healthy debate.

>In article <5c4483$bg0@earth.alpha.net>, Joe Greco <jgreco@ns.sol.net> wrote:
>>In article <5c3biu$qs4@dfw-ixnews11.ix.netcom.com>,
>>Mark Hittinger <bugs@freebsd.netcom.com> wrote:
>>>I do multiple feeds to the slaves here.  Its either have larger backlogs
>>>and nearly perfect fifo overviews or have no backlogs and not-in-order
>>>overviews.
>>
>>This sounds like something I've been working on.
>>
>>>Overview can be sorted with 'sort -n' to make it acceptable to "less tolerant
>>>readers(tm)" :-).
>>
>>Huh?
>
>If the overchan program were to keep track of the last article number 
>in a newsgroup, it could detect when it is given data for a lesser 
>article number.  It could then instead of appending the overview 
>record, rewrite the file with the new overview record inserted in the 
>proper order.  If an index of the overview file is kept in another 
>file, the rewrite can be done rather efficiently.  (Assumes that 
>the operation of opening the index file is not overly resource intensive.)  

Yes, potentially.  I considered a number of alternatives that involved
"fixing" overchan, but I was rather skeptical that any method that would
require rewriting the whole file would be practical (think about receiving
a slave feed with articles in random order, and the effect of having a
large overview file.  Assume that you are working in several groups
simultaneously, too.)

The "best" solution I could come up with was to make the records fixed
length.

>>The only consumer of the overview database files (at least in NNTP) is: 
>>nnrpd.  (Well, also expireover, but...)
>>
>>nnrpd goes to great lengths to ALWAYS provide overview data to a client
>>that requests it, using any existing ".overview" as a "cache" of already-
>>generated overview data.
>>
>>In particular, the NOV code does a linear search forward through the 
>>.overview file, caching the current location.  It will become very much
>>less efficient - but still work - if it can not find the data in the
>>.overview file, because it will open the ARTICLE and generate the data.
>>But in no case that I have seen will it cause a client to stop 
>>functioning, because nnrpd always returns the data, one way or another.
>>
>>(I just rewrote all the NNRP NOV code yet again today, so I am particularly
>>familiar with it)...
>
>>What I did:  I worked on the assumption that nonsequential delivery was a
>>likely given - many times over.  Inside nnrpd, I preprocess the data, 
>>essentially trading a full up front traversal of the .overview file (that 
>>allows me to very efficiently index the data by message number), on the 
>>assumption that once in a large group, one was likely to ask for many 
>>articles.
>
>If the overchan program did the indexing for you, for example keeping
>an .overview-index file, you'd have files you could memory map for
>efficiencies sake.  The memory savings you get from using a memory mapped
>file would be significant. (Remember to release old file versions
>regularly.)  Saving memory on a virtual memory system is equivalent to
>saving paging I/O and if you don't page, your system throughput will
>improve accordingly.

Yes, you might be able to do that, too.  It does not do much to answer
the problem of linear searches, but I would rather have linear searches
of an in-memory data structure than of a disk file.

>>It seems to be working okay, although the load averages on the machines
>>seem nearly double, performance is still excellent and I have not seen
>>any of the nasty side effects I have traditionally associated with a bunch
>>of clients grinding on the spool to manually generate NOV data.
>>
>>You might be able to do the same thing by constantly sorting your files,
>>but that's a lot of work, and doesn't happen in real time.
>
>By "real time" I assume you mean on demand by the clients.  Processing
>that can be done ahead of the demand is an improvement in service, and
>the further ahead the better.  If you can do the processing that 
>you've given to nnrpd occur in overchan, your clients will have 
>further improved response.  If you can avoid "read" operations on the 
>overchan file, and avoid the memory requirement for a read buffer (and
>it sounds like you've buffered the entire file by your comments above)
>you will have better performance.  

No.

I've mmap()'ed the entire .overview file in.  That is a separate issue and
has nothing to do with what I'm talking about.

I then walk THROUGH the file, at OVERopen time, and create an index.  This
seems expensive on large groups (i.e. "control.cancel") but does not seem
to hurt much for normal groups.

I end up doing that as a traversal of mmap()'d space (but could be a 
traversal of the disk based file via the traditional QIO access methods).

Now consider the side effects.  I'm going to oversimplify this somewhat.

Traditional: If you have a disk file and plenty of memory, you tend to 
have the overview file in cache after the first access, but you have to
research that in-core data each time you look for a record.  Even with
"last position" caching, you eat a lot of CPU time doing string copies,
ASCII-to-decimal conversions, and comparisons.

If you don't have plenty of memory, you are a hundred times worse, because
you end up hitting disk.

Hashed: you spend more time up front.  You end up pulling the entire 
overview file in memory, which is probably a good thing if you have lots
of memory.  And RAM is truly cheap these days.  Additionally, you access 
the data with a quick integer hash and linked list function, eliminating
all the grungy accesses and AtoI conversions of records you could care
less about.  AND - you don't have to worry about having your overview
database in sorted order.

Since I'm not buffering anything - I'm mmap()'ing - I don't even have to
worry too much on tight-memory systems, because it is still more optimal
than having to constantly re-search the uncached overview file.  I know
right where to go.  But there is a minor expense w.r.t. hashing the 
overview file, and that would be 16K + (12b * #entries).  My LARGEST 
newsgroup has 128616 lines in its .overview file - that means overhead
of about 1.5MB.  That same .overview file is 23MB large, and if I can
trade 1.5MB of RAM to avoid repeated traversals of a 23MB disk file,
I will!

But the REAL win is what happens when the overview data is not sorted.
If you try to read that 23MB overview file with the traditional access
methods, when it's not in the proper order, NNRP will start grinding the
system to a bloody pulp as it accesses tens of thousands of articles in
the news spool itself.

>>What I haven't done: looked at expireover to see how to make that play
>>ball.
>
>I've also hacked on nnrpd to do a few things, but what I found was 
>that my improved version didn't have a sufficiently significant impact
>on client responsiveness that maintaining my own version of the code 
>would be worthwhile.  The code I did was along the lines of what you 
>described, but didn't buffer all of the data at once.  I was 
>particularly concerned about requests for overview data in reverse 
>record order.  

I wasn't; it just happens that when I solve a problem, I try to pick the
algorithm(s) that is least capable of presenting me with a severe "worst
case" performance.

The problem I was _trying_ to solve was out-of-order overview data.

>I've found that for my site, the times when the slave falls behind in 
>it's single feed is when there are an excessive number of new files 
>being added to an already large directory.  The filesystem I am using 
>(ultrix BSD fast filesystem) does a poor job of that.  I found that if
>I filtered out the articles from the sites with the most postings to 
>"misc.jobs" (each of the thousands of articles posted weeky are on the
>senders' WWW sites in a more convenient form) my newsfeed backlogging 
>went way.

There's a thought.  "/news/control/cancel" is the other evil one, I
typically do a "cd /news/control; mv cancel x; rm -fr x" when trying
to recover.  Does wonders, didn't need that 3MB directory anyways  ;-)

>Not coincidentally, the peak in news flow during the day can coincide 
>with the peak in client activity.  For news servers which have become 
>resource constrainted, it can come down to a choice of whether the 
>client can have the news "current" or "now".  I think that for the 
>most part, clients will demand both.  Any efficiencies that can be 
>gained in either the processing of incoming news or the serving of 
>articles to the clients will benefit both activities.  I applaud your
>efforts, but find myself favoring the "now" camp.  

Eh, I don't get it.

My work was done precisely to _improve_ performance.  Anything else is
a side effect.

In a large multi-slave environment, such as the kind I'm running, or
Netcom is, it may be desirable to deliver the articles to the slaves
by any means possible.  A slave may be distant, or over a high latency
link.  Forcing ordered delivery may cause a backlog ("non-current" news).
Or you may simply be recovering from a downtime.  So the ability to 
deliver articles to the slave in an arbitrary manner and still have the
slave work correctly and rapidly is desirable.

overchan/nnrpd are problematic, because overchan assumes the data it is
writing is ordered, and nnrpd assumes that the data on disk is ordered.
That assumption breaks in light of the above "desired" ability.  I found
that even fifty clients, pounding on a machine with severely misordered
overview files, could decimate a large machine's performance by saturating
its I/O subsystem.  nnrp graciously generates the data on the fly, causing
that situation.

If you want to see what I am talking about, do the following:

% cd /nov/alt/sex
% mv .overview .overold
% sort -nr < .overold > .overview

Now open a dozen simultaneous telnet sessions to your nnrpd, and do

GROUP alt.sex
XOVER 1-99999999

in each one.

I would agree that having nnrpd preprocess the contents of the overview
file may be somewhat inefficient (at least in some cases), but it is 
NOWHERE near as inconvenient as your machine coming to a halt while
dozens of clients bash on your I/O subsystem.  And it even solves the
problem of things like reverse walkthrough's for the non-slave case.

I didn't say it was something everyone wanted to do.  I might even agree
that there are other equally feasible ways to do it, including your
overview-index idea.

But... mine was easier to code.  ;-)

Around here people like their news both "current" and "now".  I cut back
the number of reader machines last night, using this patch, and the 
burdened reader machines each handled 150% of their normal reader loads, 
without complaint, and even seemed faster than usual.

So: to put it simply, I think you're wrong, and even if not, life appears
to be better here.  ;-)

... JG

Re: caveat - multiple feeds to slaves
#14351
Author: Chrisy Luke
Date: Thu, 23 Jan 1997 00:00
38 lines
2446 bytes
On 22 Jan 1997 22:13:19 -0600, jgreco@ns.sol.net (Joe Greco) wrote:

>I'll say this again, I do not think there is any one ideal solution.

How about splitting your multiple feeds into logical groups in which
articles cannot appear out-of-order? In other words, force a feed to
be a collection of groups. You can take this two ways.

a) Firstly, the way it's taken at present, is to send an article if
one of it's groups is handled by this feed, crosslinking at the
destination.

b) Or you can say "I'll send this article because it's in this group
but I won't mention the others".

Obviously b) has problems - article being reoffered and rejected, but
not appearing in possibly key groups. a) has the problem with
crosslinking. This can be addressed by not including an article in a
groups count if that group is not one for which that feed caters.

You have to be very careful with wildcards to ensure that a group
isn't mentioned in two feeds. For this a good newsfeeds file generator
needs to be written. A feed which encompases a given group can be said
to be the "authoritive" article count for that group. We know this to
be true since the article numbering is in the order they appeared on
our feeding machine and they get queued in the same order.

I have a subset of this working quite well, and have used this
approach to loadbalance multiple feeds for a long time.

Chris.
== chrisy@easynet.net, chrisy@flirble.org, chrisy@etsiig.uniovi.es
== Newsmaster and Senior Systems Developer for Easynet Group Plc.
== I recently saw a Flirble, in the bushes on Regents Park. It
== frowned at me and said "If it were Wimbledon you wouldn't stare!"

Re: caveat - multiple feeds to slaves
#14372
Author: Sven Paulus
Date: Thu, 23 Jan 1997 00:00
18 lines
1459 bytes
Joe Greco <jgreco@ns.sol.net> wrote:
 JG> Yes, potentially.  I considered a number of alternatives that involved
 JG> "fixing" overchan, but I was rather skeptical that any method that would
 JG> require rewriting the whole file would be practical

How about taking nntpcacheds approach: splitting overview into multiple
files, each containing overview information for about 50 articles and having
filenames like over.view-low#-hi#. Rewriting these won't be too difficult.

Sven
-- 
--Sven-Paulus----------28-48-32--3-----ub6v@rz.uni-karlsruhe.de------
--Karlstr.-55----------30--2-50-29-----sven@oops.sub.de--------------
--D-76133-Karlsruhe----44-49-10--8-----T#-49-721-9375094-------irc---
--Fido-2:2476/530-------9-12-19-71-----F#-49-721-9375095-----svennie-

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