🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
8 messages
8 total messages Started by Luu Tran Wed, 08 Dec 1999 00:00
ARTICLE efficiency.
#42058
Author: Luu Tran
Date: Wed, 08 Dec 1999 00:00
17 lines
1045 bytes
Hello

I don't know the internal working of server software, so here's a 
question for those who do:  In general, is it more efficient to do 
ARTICLE by msg-id or article-no?  Obviously, to do the latter, you first 
need to do a GROUP command, which may be slow.  But perhaps the lookup 
time for article-no, once you're in a group, is shorter?  Or does it 
matter either way?  Simple experimentation on my part doesn't show much 
difference in server response.

TIA

-- 
  luu


Re: ARTICLE efficiency.
#42042
Author: Curt Welch
Date: Wed, 08 Dec 1999 00:00
57 lines
3732 bytes
Russ Allbery <rra@stanford.edu> wrote:
> Luu Tran <luutran@nomail.invalid> writes:
>
> > I don't know the internal working of server software, so here's a
> > question for those who do:  In general, is it more efficient to do
> > ARTICLE by msg-id or article-no?  Obviously, to do the latter, you
> > first need to do a GROUP command, which may be slow.  But perhaps the
> > lookup time for article-no, once you're in a group, is shorter?

It's going to depend a lot on the server software and on how it's
configured.  In general, both will be about as fast I'd guess.

It also depends on if you are constantly switching groups for each
article.  If you read 10 articles from the same group, then doing one
group command and 10 article commands by article number will most likely
be slightly faster than 10 article commands by message-id.

But 10 sets of GROUP/ARTCICLE <#> will likely be slower than 10 ARTICLE
<ID> commands if the group is different for each article.

> For a server using traditional spool, ARTICLE by article number after
> you've done a GROUP command is slightly more efficient since it means not
> having to do a history lookup.  With other storage mechanisms, it may
> vary, although in general you're still shortcutting the history lookup or
> whatever the equivalent is in that server, and therefore requesting
> articles by group number will probably still be somewhat faster.
>
> > Simple experimentation on my part doesn't show much difference in
> > server response.
>
> History lookups (or the equivalent) are generally fairly fast.
>
> More critically, though, I believe some servers don't guarantee that
> article lookup by message ID will succeed, even if the article is present
> on the server.  So you may wish to prefer article numbers for the sake of
> correctness.  I could be misremembering this, though.

I know typhoon had the problem that lookup by message-id didn't work if
the message-id wasn't in the history file.  You had to configure the size
of the history file and if you set it too small for the size of your
spool, then history info would expire before the actual article did, and
at that point, ARTICLE <mid> would stop working even though the article
was still on the server and could be retrived using GROUP and article
numbers. Don't know if typhoon still works that way or not.  But if so,
it's possible lookup by Message-ID will fail for some of the older
articles, but not for all.

In general, when writing an NNTP client, I think one should always assume
that article retreival by number will always work (and will be about as
fast as possible for the server), and that article retrival by message-id
will probably work (so you can use it when you need to), but may not.

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

Re: ARTICLE efficiency.
#42051
Author: Alternative Fluffy
Date: Wed, 08 Dec 1999 00:00
27 lines
1995 bytes
Luu Tran <luutran@nomail.invalid> wrote:

> Hello
> I don't know the internal working of server software, so here's a 
> question for those who do:  In general, is it more efficient to do 
> ARTICLE by msg-id or article-no?

They are generally comparable.  Implementations vary from server to
server and even from version to version of the same server.  More
below...

> Obviously, to do the latter, you first > need to do a GROUP
> command, which may be slow.

Under some common implementatins GROUP is a very expensive operation,
so if you are *not* already in the group, grabbing the message by ID
will be cheaper.  If you are in that group, go ahead and grab by
number, since you've already asked the server to do the indexing work.

BUT (isn't there always a but?) some servers take shortcuts.  You
might not be able to fetch older articles by ID, or ARTICLE <id> might
not work at all.  GROUP/ARTICLE nnn is your best bet for portability,
even if it's not always the fastest way.

Sorry for asking yet?

Re: ARTICLE efficiency.
#42087
Author: Luu Tran
Date: Fri, 10 Dec 1999 00:00
20 lines
1149 bytes
gerglery@usa.net (Alternative Fluffy) wrote in 
<873dtd6pkx.fsf@meowhost.meow.invalid>:

>BUT (isn't there always a but?) some servers take shortcuts.  You
>might not be able to fetch older articles by ID, or ARTICLE <id> might
>not work at all.  GROUP/ARTICLE nnn is your best bet for portability,
>even if it's not always the fastest way.
>
>Sorry for asking yet?
>

Yes :)  I thought the two were functionally equivalent.  Guess not.

Thanks all for your replies.

-- 
  luu


Re: ARTICLE efficiency.
#42116
Author: bill davidsen
Date: Mon, 13 Dec 1999 00:00
31 lines
2242 bytes
In article <ylwvqp84hk.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
| Luu Tran <luutran@nomail.invalid> writes:
| 
| > I don't know the internal working of server software, so here's a
| > question for those who do:  In general, is it more efficient to do
| > ARTICLE by msg-id or article-no?  Obviously, to do the latter, you first
| > need to do a GROUP command, which may be slow.  But perhaps the lookup
| > time for article-no, once you're in a group, is shorter?
| 
| For a server using traditional spool, ARTICLE by article number after
| you've done a GROUP command is slightly more efficient since it means not
| having to do a history lookup.  With other storage mechanisms, it may
| vary, although in general you're still shortcutting the history lookup or
| whatever the equivalent is in that server, and therefore requesting
| articles by group number will probably still be somewhat faster.

  Educate me on that one... how would nnrpd get the cookie needed for sm
unless it did a history lookup? I thought the process was artnum to
message-id (via overview) to cooky via lookup to text via sm.

  Do I misremember the logic? Is there some artnum to cookie other than
oview?

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

Re: ARTICLE efficiency.
#42124
Author: Alternative Fluffy
Date: Mon, 13 Dec 1999 00:00
17 lines
1688 bytes
bill davidsen <davidsen@tmr.com> wrote:

>   Educate me on that one... how would nnrpd get the cookie needed for sm
> unless it did a history lookup? I thought the process was artnum to
> message-id (via overview) to cooky via lookup to text via sm.

In -CURRENT, the overview index holds a copy of the token.  This is
painfully fast.

For 2.0 through 2.2, you need to consult history if you're using the
storage mangler.  This is painfully slow.

For 2.2 and earlier with traditional spool, no translation is needed,
of course.  The directory scan on GROUP is painfully slow, but
subsequent retrievals are okay fine.

Re: ARTICLE efficiency.
#42167
Author: Alternative Fluffy
Date: Tue, 14 Dec 1999 00:00
13 lines
1518 bytes
bill davidsen <davidsen@tmr.com> wrote:

> Russ Allbery  <rra@stanford.edu> wrote:

> | The token is stored directly in the overview.

>   Ok, I looked in 2.3, no token there. I do see the filename in ASCII
> and the offset, I presume that's what you mean, rather than the @token@
> as in history.

Try poking around with od or whatever -- the tokens are in binary form.

Re: ARTICLE efficiency.
#42216
Author: bill davidsen
Date: Wed, 15 Dec 1999 00:00
24 lines
1744 bytes
In article <ylln6yzk3d.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
| bill davidsen <davidsen@tmr.com> writes:
| 
| > Educate me on that one... how would nnrpd get the cookie needed for sm
| > unless it did a history lookup? I thought the process was artnum to
| > message-id (via overview) to cooky via lookup to text via sm.
| 
| The token is stored directly in the overview.

  Ok, I looked in 2.3, no token there. I do see the filename in ASCII
and the offset, I presume that's what you mean, rather than the @token@
as in history.

  Thanks for the pointer, I just did a dump piped into grep for the @
string...

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

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