🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
15 messages
15 total messages Started by Jeremy Wed, 29 Jul 1998 00:00
Speeding up INN's GROUP command (was: Re: Getting slrn to use LIST ACTIVE instead of GROUP?)
#30173
Author: Jeremy
Date: Wed, 29 Jul 1998 00:00
50 lines
3635 bytes
I'm crossposting this to news.software.nntp, as it's departed from
the realm of client software. :)  Followups directed there...

For those just joining us, I was trying, unsuccessfully, to find a
way to speed up INN's GROUP command, which scans the entire directory
and thus can take an eternity in a very large group.  At Supernews
we have groups with tens of thousands of articles present, creating
a long wait for users of newsreaders that use a series of GROUP
commands to create a list of newsgroups with article counts.

Curt Welch <curt@kcwc.com> wrote:
> jeremy@exit109.com (Jeremy) wrote:
>
>> Hmm.  I wonder if a quick and dirty fix would be to make GROUP get
>> its numbers from active?  Or would that break something...?  Hmm,
>> something to ask our programmer about...
> 
> I'm pretty sure that the old inn nnrpd will do that and remember the
> list of valid articles.  Then, when you do an XOVER, it matches that
> list against the XOVER data and removes the XOVER records (from the
> response) for missing articles.  I'd guess that it also uses that list
> for stepping though the articles with NEXT and LAST etc.  So if you
> don't read the directory and build that list, you will either have to
> do it later, or you will just loose the accuracy of knowing which
> articles are really there and which aren't.

Yeah, that's what it'll break, I didn't think of that.

On the other hand ... if you don't process cancels, there won't *be* any
missing articles, right? :)

> This is the problem that INN 2.0 created and it means the newsreaders
> will show the user headers for articles that have been cancled.  And
> then returns errors when the user tries to read them.  A real step
> backwards in functionality.
> 
> What you might want to do is hack in a change to GROUP that will limit
> the number of article names it will read from the directory to something
> like 1,000.  When it hits the limit, it just gives up and returns the
> active file info for the GROUP command.  But remember the fact that
> the article list isn't yet valid so you can go back and do it compleletly
> when (and if) it's needed.  This gives you fast GROUP commands for
> clients that do a series of GROUP commands on start up, but retains
> the accuracy of the info GROUP returns for small groups.

-- 
Jeremy  |  jeremy@exit109.com
"Everything you think you know is wrong."  --Jack Chalker

Re: Speeding up INN's GROUP command (was: Re: Getting slrn to use LIST ACTIVE instead of GROUP?)
#30131
Author: Clayton O'Neill
Date: Wed, 29 Jul 1998 00:00
18 lines
2053 bytes
On 29 Jul 1998 20:06:57 GMT, Curt Welch <curt@kcwc.com> wrote:
|usenet@oneill.net (Clayton O'Neill) wrote:
|> No, what you want to do is add another byte to the overview indexes that
|> indicates that the article is canceled and then don't report those
|> articles back to the user.  This was the original intent with overview
|> indexes. Hell, you don't even need the flag, just set the artnum to -1.

|So with 2.0 are the overview indexes fixed length so you could seek to the
|correct record and update it with a -1 artnum?  Is that what you are
|talking about?  Was it not done because of performance reasons?

They're fixed length, but necessarily in order.  Regardless, right now each
record is only 8 bytes, so reading the entire thing is not a big deal.

-- 
coneill@rcn.com|blahlblahblah@oneill.net

Re: Speeding up INN's GROUP command (was: Re: Getting slrn to use LIST ACTIVE instead of GROUP?)
#30134
Author: Charlie Fluffy
Date: Wed, 29 Jul 1998 00:00
13 lines
1469 bytes
On 29 Jul 1998, Jeremy wrote:

> On the other hand ... if you don't process cancels, there won't *be* any
> missing articles, right? :)

Bah.  May I introduce you to our fscked-up filesystem?  I hate hardware


Barry Bouwsma
flaky disks seem to congregate around me wherever I go, danger


Re: Speeding up INN's GROUP command (was: Re: Getting slrn to use LIST ACTIVE instead of GROUP?)
#30139
Author: Clayton O'Neill
Date: Wed, 29 Jul 1998 00:00
23 lines
2319 bytes
|> This is the problem that INN 2.0 created and it means the newsreaders
|> will show the user headers for articles that have been cancled.  And
|> then returns errors when the user tries to read them.  A real step
|> backwards in functionality.
|> 
|> What you might want to do is hack in a change to GROUP that will limit
|> the number of article names it will read from the directory to something
|> like 1,000.  When it hits the limit, it just gives up and returns the
|> active file info for the GROUP command.  But remember the fact that
|> the article list isn't yet valid so you can go back and do it compleletly
|> when (and if) it's needed.  This gives you fast GROUP commands for
|> clients that do a series of GROUP commands on start up, but retains
|> the accuracy of the info GROUP returns for small groups.

No, what you want to do is add another byte to the overview indexes that
indicates that the article is canceled and then don't report those articles
back to the user.  This was the original intent with overview indexes. Hell,
you don't even need the flag, just set the artnum to -1.

-- 
coneill@rcn.com|blahlblahblah@oneill.net

Re: Speeding up INN's GROUP command (was: Re: Getting slrn to use LIST ACTIVE instead of GROUP?)
#30140
Author: Curt Welch
Date: Wed, 29 Jul 1998 00:00
20 lines
2078 bytes
jeremy@exit109.com (Jeremy) wrote:
> On the other hand ... if you don't process cancels, there won't *be* any
> missing articles, right? :)

Mostly.  If you don't process cancels then removing that dir scan logic
from GROUP could make a lot of sense.

But, watch out for those stupid sub-groups with all numeric names that
tend to fool inn.  like alt.2600.414, alt.music.311, and
alt.autos.porsche.911. It makes inn think the low water mark in the
alt.2600 group is 411.  That creates a large chunk of missing articles.
Fixing the renumber logic so it's not fooled by newsgroup names might be a
good solution for that issue.  Or you could just refuse to carry those
groups.

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

Re: Speeding up INN's GROUP command (was: Re: Getting slrn to use LIST ACTIVE instead of GROUP?)
#30145
Author: Curt Welch
Date: Wed, 29 Jul 1998 00:00
44 lines
3701 bytes
usenet@oneill.net (Clayton O'Neill) wrote:
> |> This is the problem that INN 2.0 created and it means the newsreaders
> |> will show the user headers for articles that have been cancled.  And
> |> then returns errors when the user tries to read them.  A real step
> |> backwards in functionality.
> |>
> |> What you might want to do is hack in a change to GROUP that will limit
> |> the number of article names it will read from the directory to
> |> something like 1,000.  When it hits the limit, it just gives up and
> |> returns the active file info for the GROUP command.  But remember the
> |> fact that the article list isn't yet valid so you can go back and do
> |> it compleletly when (and if) it's needed.  This gives you fast GROUP
> |> commands for clients that do a series of GROUP commands on start up,
> |> but retains the accuracy of the info GROUP returns for small groups.
>
> No, what you want to do is add another byte to the overview indexes that
> indicates that the article is canceled and then don't report those
> articles back to the user.  This was the original intent with overview
> indexes. Hell, you don't even need the flag, just set the artnum to -1.

I assumed he was talking about what he could do with a pre-2.0
version of INN.

But I like that idea.  When I saw the problem that inn 2.0 didn't have
a way to update the overview to reflect cancled articles it occured to
me as well that you should just update the overview.  I was thinking that
for a traditional overview format you could append special cancel records
to the end of the overview data as articles were cancled.  That would be
easier and more efficient than trying to scan back and somehow update
the actual overview record for the article.  NNRPD (or whoever) would read
the entire overview and sort out the cancled articles from this
information. If need be for space reasons it could just scan the overview
file twice, once to remember all the cancel records and a second time to
read and output the overview records.

So with 2.0 are the overview indexes fixed length so you could seek to the
correct record and update it with a -1 artnum?  Is that what you are
talking about?  Was it not done because of performance reasons?

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

Re: Speeding up INN's GROUP command (was: Re: Getting slrn to use LIST ACTIVE instead of GROUP?)
#30146
Author: Josh Gagliardi
Date: Wed, 29 Jul 1998 00:00
34 lines
2864 bytes
> I don't quite see the point of this.  So LIST COUNTS does the same
> thing as GROUP execpt it just doesn't have the side effects of changing
> the current group?  And Typhoon can somehow do a LIST COUNTS faster
> than a GROUP command?
> 
> So newsreaders will issue 1000 LIST COUNTS comands instead of 1000
> GROUP commands? (a single LIST COUNTS which dumps the entire active
> file is out of the question for slow links).

Sorry, I didn't make myself clear.  The intention is that a browser can
say "LIST COUNTS *" and find out the article _count_ in every group in
addition to finding out the high and low bounds as happens now.  I was
speaking from protocol-centric point-of-view:  clearly graphical
browsers want to display the count of available articles for every
group, and resorted to the group-group-group method to find this
information out.  Since most servers interpret GROUP as an intention to
read articles, our engineers thought extending the LIST command to give
a more complete snapshot of multiple groups with a single protocol
request made sense.

> If GROUP is too slow because of what it does to set up the current
> group wouldn't it be better to delay that setup work (like we have been
> talking about here) which makes GROUP as fast as LIST COUNTS?  And

This is exactly our intent:  that GROUP be considered a commitment by a
browser to actually read articles from a single group, and that some
other command be used when only summary information about the group is
desired.

> then no one will need to deal with new NNTP commands.

This protocol has enough unsupportable stuff in it already...

Re: Speeding up INN's GROUP command (was: Re: Getting slrn to use LIST ACTIVE instead of GROUP?)
#30150
Author: Andrew Gierth
Date: Wed, 29 Jul 1998 00:00
14 lines
1790 bytes
>>>>> "Josh" == Josh Gagliardi <gagliardi@mediaone.net> writes:

 Josh> Sorry, I didn't make myself clear.  The intention is that a
 Josh> browser can say "LIST COUNTS *" and find out the article
 Josh> _count_ in every group

Doesn't scale - over a dialup to a server with a lot of groups that'll
take five or ten minutes. Clients simply won't do that - they'll do one
command per subscribed group.

-- 
Andrew.

Re: Speeding up INN's GROUP command (was: Re: Getting slrn to use LIST ACTIVE instead of GROUP?)
#30151
Author: Curt Welch
Date: Wed, 29 Jul 1998 00:00
27 lines
2567 bytes
Josh Gagliardi <gagliardi@mediaone.net> wrote:
> To address this problem in Typhoon, HighWind added a LIST command
> variant called "LIST COUNTS", whose output just like the LIST ACTIVE
> output but with an extra column with the article count for each
> newsgroup.  We hope to introduce this into standards discussions so that
> someday browsers will ask what they really want to know instead of
> issuing 1000 GROUP commands when they first connect.

I don't quite see the point of this.  So LIST COUNTS does the same
thing as GROUP execpt it just doesn't have the side effects of changing
the current group?  And Typhoon can somehow do a LIST COUNTS faster
than a GROUP command?

So newsreaders will issue 1000 LIST COUNTS comands instead of 1000
GROUP commands? (a single LIST COUNTS which dumps the entire active
file is out of the question for slow links).

If GROUP is too slow because of what it does to set up the current
group wouldn't it be better to delay that setup work (like we have been
talking about here) which makes GROUP as fast as LIST COUNTS?  And
then no one will need to deal with new NNTP commands.

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

Re: Speeding up INN's GROUP command (was: Re: Getting slrn to use LIST ACTIVE instead of GROUP?)
#30153
Author: Grigori Vulis
Date: Wed, 29 Jul 1998 00:00
26 lines
2284 bytes
Jeremy <jeremy@exit109.com> wrote:

> Curt Welch <curt@kcwc.com> wrote:
> > I'm pretty sure that the old inn nnrpd will do that and remember the
> > list of valid articles.  Then, when you do an XOVER, it matches that
> > list against the XOVER data and removes the XOVER records (from the
> > response) for missing articles.  I'd guess that it also uses that list
> > for stepping though the articles with NEXT and LAST etc.  So if you
> > don't read the directory and build that list, you will either have to
> > do it later, or you will just loose the accuracy of knowing which
> > articles are really there and which aren't.
> 
> Yeah, that's what it'll break, I didn't think of that.

Strike a compromise, then.  When the GROUP command is executed, just
display the numbers from active and don't count articles yet.  Put
false in little boolean flag that marks the group count as unreliable. 
Now, put a bit of code at the beginning of each command that depends on
that group count that performs the dir scan and sets the flag to true,
if the flag isn't already set true.

This ought to make newsreader refreshes wicked fast, and you'll only
incur the scan overhead if the user actually goes in and looks at the
froup.

Re: Speeding up INN's GROUP command (was: Re: Getting slrn to use LIST ACTIVE instead of GROUP?)
#30167
Author: Clayton O'Neill
Date: Wed, 29 Jul 1998 00:00
18 lines
1700 bytes
On 29 Jul 1998 20:36:29 GMT, Olaf Titz <olaf@bigred.inka.de> wrote:
|Clayton O'Neill <usenet@oneill.net> wrote:
|> No, what you want to do is add another byte to the overview indexes that
|> indicates that the article is canceled and then don't report those articles
|> back to the user.  This was the original intent with overview indexes. Hell,
|
|Or store the complete token in the overview index, so you don't need
|any history lookups for accessing overview at all. Of course, the
|token already contains your cancelled flag. :-)

Actually, this was my original intent.  I believe that was ripped out before
release.  The nice thing about that was that you can do article retrieval in
two seeks, one if you already have the overview.index in memory.

-- 
coneill@rcn.com|blahlblahblah@oneill.net

Re: Speeding up INN's GROUP command (was: Re: Getting slrn to use LIST ACTIVE instead of GROUP?)
#30181
Author: Josh Gagliardi
Date: Wed, 29 Jul 1998 00:00
10 lines
1564 bytes
To address this problem in Typhoon, HighWind added a LIST command
variant called "LIST COUNTS", whose output just like the LIST ACTIVE
output but with an extra column with the article count for each
newsgroup.  We hope to introduce this into standards discussions so that
someday browsers will ask what they really want to know instead of
issuing 1000 GROUP commands when they first connect.

--Josh Gagliardi (at home)

Re: Speeding up INN's GROUP command (was: Re: Getting slrn to use LIST ACTIVE instead of GROUP?)
#30185
Author: T. William Wells
Date: Thu, 30 Jul 1998 00:00
12 lines
1288 bytes
In article <6pmhd0$ggr$1@news1.exit109.com>, Jeremy <jeremy@exit109.com> wrote:
: For those just joining us, I was trying, unsuccessfully, to find a
: way to speed up INN's GROUP command, which scans the entire directory
: and thus can take an eternity in a very large group.

Write a daemon that caches the contents of the newsgroup
directories and have nnrpd query that. Perhaps modify innd to send
messages for cancels. Since these are numeric names, you can use
bitmaps to store them. Memory usage is nominal, with anything like
reasonable data structures.

Re: Speeding up INN's GROUP command (was: Re: Getting slrn to use LIST ACTIVE instead of GROUP?)
#30205
Author: Reality is a point of view
Date: Thu, 30 Jul 1998 00:00
30 lines
2500 bytes
 +---- gagliardi@mediaone.net wrote (Wed, 29 Jul 1998 14:11:06 -0400):
 | To address this problem in Typhoon, HighWind added a LIST command
 | variant called "LIST COUNTS", whose output just like the LIST ACTIVE
 | output but with an extra column with the article count for each
 | newsgroup.  We hope to introduce this into standards discussions so that
 | someday browsers will ask what they really want to know instead of
 | issuing 1000 GROUP commands when they first connect.
 +----

(As mentioned on the n.s.r version of this thread . . .)

If new commands are the fix I suggest something that gives
GROUPish context without the overhead.  The LIST ACTIVE, XOVER,
ARTICLE sequence works fine on the server in question.

The delay comes from GROUP commands.  A lot of delay if it is
used to pull newsgroup stats, a little delay if it is used to
give XOVER and ARTICLE their context.  In the second case the
data that GROUP provides isn't needed, just the newsgroup
context, and everything is fast.  Except for the GROUP request.

But then I prefer .article directories over bubbling up .misc
requirements, and | over the tasteless > for (soon to be
official?) quoting characters, so what do I know . . .

-- 
Gary Johnson     gjohnson@season.com
Privacy on the net is still illegal.

Re: Speeding up INN's GROUP command (was: Re: Getting slrn to use LIST ACTIVE instead of GROUP?)
#30394
Author: Joe Greco
Date: Mon, 10 Aug 1998 00:00
33 lines
2486 bytes
In news.software.nntp article <slrn6rv34c.qn.usenet@hmmm.colo.erols.net>, usenet@oneill.net (Clayton O'Neill) wrote:
:On 29 Jul 1998 20:06:57 GMT, Curt Welch <curt@kcwc.com> wrote:
:|usenet@oneill.net (Clayton O'Neill) wrote:
:|> No, what you want to do is add another byte to the overview indexes that
:|> indicates that the article is canceled and then don't report those
:|> articles back to the user.  This was the original intent with overview
:|> indexes. Hell, you don't even need the flag, just set the artnum to -1.
:
:|So with 2.0 are the overview indexes fixed length so you could seek to the
:|correct record and update it with a -1 artnum?  Is that what you are
:|talking about?  Was it not done because of performance reasons?
:
:They're fixed length, but necessarily in order.  Regardless, right now each
:record is only 8 bytes, so reading the entire thing is not a big deal.

This probably isn't relevant except loosely...  my MMAP'd overview patches
for INN1.* allowed the option of sorting the overview data, which required
that you actually read the overview data in in one big gulp...

This helps with a variety of things, including a sick slave reader that is 
way far behind and you choose to sort the batch file for it, or something 
like that...  the NOV records get written out of order but you really do
not care too much.

That same sort of strategy would allow articles to be easily "cancelled" by
a cancel record, as suggested.

Doing this would effectively eliminate the dir read requirement, at the
expense of requiring overview data.

... JG

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