🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
22 messages
22 total messages Started by David A. Bartizal Tue, 11 Feb 1997 00:00
NEWNEWS Command
#14972
Author: David A. Bartizal
Date: Tue, 11 Feb 1997 00:00
33 lines
1844 bytes
I am fairly new to the world of NNTP programming so if this question
is stupid, please tell me, but please answer it anyway. Sorry in
advance.

I was working on an application to retrieve article headers from a
newsserver for review and marking offline for later article retrieval.
I am sure there are applications that already do this, but I want to
learn something about internet programming and NNTP seemed like a good
place to start (what a fool). Anyway, recently my ISP "upgraded" their
server and in the process disabled the NEWNEWS command. They tell me
(none too politely) that this is the default, all newsreader software
they are aware of can "handle" this and are implying that it is my
tough luck as they do not know how readers get a list of new articles.
While all this may be true, I am still stuck with a half written
application and I do not know where to go with it. Sob. Sob.

So if you feel sorry for me, or just can't stand ISP's who do not give
a damn about customers or are just a kind person, please help me:

1.  What method do other readers use to get a list of new articles?

2. Why is the NEWNEWS command being phased out. It seems like a good
method to issue one simple command? There *must* be some better way,
eh?

Thanks,

David A. Bartizal
dabart1@solution4u.com


Re: NEWNEWS Command
#14956
Author: Terry Kennedy
Date: Tue, 11 Feb 1997 00:00
49 lines
3159 bytes
David A. Bartizal <dabart1@solution4u.com> writes:
> 1.  What method do other readers use to get a list of new articles?

  Readers maintain a list of the article sequence numbers they've already
seen. Most Unix newsreaders use the .newsrc file for this, which contains
one line for each group of interest, followed by a colon+space and one or
more article ranges.

> 2. Why is the NEWNEWS command being phased out. It seems like a good
> method to issue one simple command? There *must* be some better way,
> eh?

  A long time ago, Usenet news was low volume - I remember when a one month
article retention would happily fit in 500MB. These days, news is several
GB per day. While a lot of that is people distributing pirated software and
dirty pictures, a lot of it is just an increased quantity of articles.

  All of the common news transports NEWNEWS commands do a search through the
news "history file". This file has grown in step with the number of articles
and can now be quite large (on one of my servers it's > 150MB). While the
news server is searching this file for you, it isn't doing any work for other
users.

  There are a number of ways to get equivalent info. Which is best probably
depends on which server your ISP is running.

  You can do a "list active" or a "group group.name" to get the current low
and high article numbers in the groups (the first form gives you the info for
all the group, the second for a specific group).

  You can then either save that info so you know what article to start with
next time, or you're storing message ID's you can do "xhdr Message-ID low-hi"
commands to get all of the message ID's. Assuming that the server is using
an overview database (a very common assumption these days) this is a low-
overhead command. Of course, if you know you've seen some of the articles,
you don't have to ask for all the ID's - just the ones for articles you haven't
already seen. You can also xhdr many other useful header fields (From, Subject,
etc.).

  I'd also suggest that you look at some of the utilities that allow you to
pull a newsfeed from a non-cooperating server - suck, slurp, etc. Some of these
use NEWNEWS, while others are more intelligent.

	Terry Kennedy		  Operations Manager, Academic Computing
	terry@spcvxa.spc.edu	  St. Peter's College, Jersey City, NJ USA
        +1 201 915 9381 (voice)   +1 201 435-3662 (FAX)

Re: NEWNEWS Command
#14958
Author: Egil Kvaleberg
Date: Tue, 11 Feb 1997 00:00
35 lines
1723 bytes
On Tue, 11 Feb 1997, David A. Bartizal wrote:

> 1.  What method do other readers use to get a list of new articles?

An efficient and simple method:

Maintaining a "high water mark" for each newsgroup, i.e. the max article 
number you have seen. New articles will have article numbers above this.

> 2. Why is the NEWNEWS command being phased out. It seems like a good
> method to issue one simple command?

Yes, but the usual implementation of this command makes it very
inefficient, straining the server excessively.

It could have been (and, indeed, has been) implemented more efficiently. 
But other methods has been favored, so NEWNEWS is definitely on the way
out. 

> There *must* be some better way,
> eh?

I suggest you take a look at the vast amount of news related free software
already available, that would give you a number of hints. 

Egil
-- 
Email: egilk@sn.no  Voice: +47 22523641, 92022780 Fax: +47 22525899
Snail: Egil Kvaleberg, Husebybakken 14A, 0379 Oslo, Norway
URL:   http://home.sn.no/home/egilk/
URL:   http://home.sn.no/home/egilk/newsx.html


Re: NEWNEWS Command
#14992
Author: Forrest J. Cavalier III
Date: Wed, 12 Feb 1997 00:00
25 lines
1640 bytes
>>it's using the ID's hash to look in the history file and pull out the
>>path and item number.
>
>Something like that. The dbz database contains a map of Message-ID to seek
>position within the text file. This leads to a very fast lookup of where
>an article lives on the spool.
>

The alternative that I proposed in "Redesign the spool and history database"
thread was to use the message ID itself as the file name.  This idea
is not a new one, as the thread discusses.  But no-one seems to have
extended the idea to readers.  Then the nnrpd program could get messages
by ID without having to consult anything.  (Well, my idea was a bit more 
complicated, but essentially the same.)

I haven't looked at the INN code, but doesn't the NEWNEWS command have to
sort out which groups were involved?  
It is not as simple as a quick tour through the history file, is it?

Forrest Cavalier
Mib Software


Re: NEWNEWS Command
#15000
Author: Terry Kennedy
Date: Wed, 12 Feb 1997 00:00
52 lines
3604 bytes
Simon Burr <simes@bpfh.net> writes:
> This is true, however this is generally *not* the resource hungry part of using
> NEWNEWS to get new articles. The reader program in INN, nnrpd, uses a binary
> search to find the start of the articles that should even be looked at for
> return to the client. From that point each entry in the history database is
> checked to see if it matches the request the user made in the NEWNEWS command.
> This is quite efficently written. The problem is that the list of articles which
> match the request the client made is returned as a list of Message-IDs. Thus
> the client has to request each article by its Message-ID. It is this part that
> is expensive as nnrpd has to look in the history database to turn the given
> Message-ID into the article's location on the spool.

  I use C News + the reference NNTP plus a bunch of local enhancements, so I'm
not entirely conversant with INN. However, in my environment an ARTICLE command
that specifies a Message-ID returns the article in milliseconds. I assume that
it's using the ID's hash to look in the history file and pull out the path and
item number. I'd be *very* surprised if INN didn't do something similar - if it
didn't, IHAVE and CHECK commands would take *forever*.

> It is interesting to note that at least one suck-style program which doesn't
> use NEWNEWS to get the articles required (AFAIR it used the overview database to
> get the Message-IDs of the articles in each group), but still got the articles
> by Message-ID. Since it is the getting of articles by Message-ID that actually
> hurts the news server, clients which do this are just as bad as clients that
> make use of NEWNEWS.

  I have a customer system pulling a full feed via one of these things, and the
NNTP process is using about 1MB of memory:

USER       PID %CPU %MEM   VSZ  RSS  TT  STAT STARTED       TIME COMMAND
news     12372  0.0  0.9  1420 1132  ??  S     7:31AM    0:01.47 -hostname ARTICLE

  And this is without shared-anything...

> > While the
> > news server is searching this file for you, it isn't doing any work for other
> > users.
>
> This is not the case. Multiple nnrpds can run searches on the history database
> at the same time. Considering that news servers frequently run 300+
> simultaneous readers it would be a *real* problem if this was the case.

  Let me expand on this a bit. If the nntpd is reading the history database
full-tilt, there's less I/O capacity for other accesses of the history data-
base, as well (if history is on the same disk as articles) as articles.

	Terry Kennedy		  Operations Manager, Academic Computing
	terry@spcvxa.spc.edu	  St. Peter's College, Jersey City, NJ USA
        +1 201 915 9381 (voice)   +1 201 435-3662 (FAX)

Re: NEWNEWS Command
#15008
Author: Simon Burr
Date: Wed, 12 Feb 1997 00:00
55 lines
3210 bytes
Terry Kennedy wrote:
>I use C News + the reference NNTP plus a bunch of local enhancements,
>so I'm not entirely conversant with INN. However, in my environment an
>ARTICLE command that specifies a Message-ID returns the article in
>milliseconds.

The same is true for INN. The problems occur with INN since nnrpd starts
to read the history database into memory to do this. So doing just one
ARTICLE command with a Message-ID isn't going to hurt too much. Its when
lots of ARTICLE commands using Message-IDs are used that problems start to
occur. When this happens more and more of the history database is read
into memory. As I said before, enough of these processes and a news server
can quickly run itself into the ground.

innd does something similar. This is one of the reasons why innd can grow
quite large, anything from 20-90Mb depending on what the news server is
doing.

>it's using the ID's hash to look in the history file and pull out the
>path and item number.

Something like that. The dbz database contains a map of Message-ID to seek
position within the text file. This leads to a very fast lookup of where
an article lives on the spool.

>I have a customer system pulling a full feed via one of these things, and
>the NNTP process is using about 1MB of memory:

I can't really comment, not knowing how your news system works indepth.
I'd guess that the reader program, unlike nnrpd, doesn't read the history
database into memory. I this is the case, it is going to have a smaller
memory footprint.

>Let me expand on this a bit. If the nntpd is reading the history database
>full-tilt, there's less I/O capacity for other accesses of the history
>data-base, as well (..) as articles.

Sortof. Don't forget that the OS will be doing things like caching the
requested blocks, etc. AFAICT part of the reason nnrpd reads the history
dbz into memory is to reduce hits upon it. Whilst this is a good idea when
there is lots of memory available, it can be a loss when memory starts to
run out and a system starts to swap more.

> (if history is on the same disk as articles)

Personally I'd say that you need to place the history files on a different
disk to the articles. Even better is to place the disks the spool is made
up of onto a separate SCSI bus (or buses) from the rest of the news system.

--
Simon Burr                             Work: simonb@uunet.pipex.com
Systems Engineering, UUNetPipex        Play: simes@bpfh.net

Re: NEWNEWS Command
#15011
Author: Simon Burr
Date: Wed, 12 Feb 1997 00:00
45 lines
3061 bytes
Terry Kennedy wrote:
>   All of the common news transports NEWNEWS commands do a search through the
> news "history file". This file has grown in step with the number of articles
> and can now be quite large (on one of my servers it's > 150MB).

This is true, however this is generally *not* the resource hungry part of using
NEWNEWS to get new articles. The reader program in INN, nnrpd, uses a binary
search to find the start of the articles that should even be looked at for
return to the client. From that point each entry in the history database is
checked to see if it matches the request the user made in the NEWNEWS command.
This is quite efficently written. The problem is that the list of articles which
match the request the client made is returned as a list of Message-IDs. Thus
the client has to request each article by its Message-ID. It is this part that
is expensive as nnrpd has to look in the history database to turn the given
Message-ID into the article's location on the spool.

When I did some work in this area about a year ago, I found that the NEWNEWS
command itself didn't impact performance that much. It was when the client
started issuing requests for articles by Message-ID that the problems started.
At that point the nnrpd getting such requests would grow in size as more of the
history database was read into core. Such nnrpds would be using 16Mb+ of real
memory (ie not swapped out). It doesn't that many processes like that to really
hurt a news server.

It is interesting to note that at least one suck-style program which doesn't
use NEWNEWS to get the articles required (AFAIR it used the overview database to
get the Message-IDs of the articles in each group), but still got the articles
by Message-ID. Since it is the getting of articles by Message-ID that actually
hurts the news server, clients which do this are just as bad as clients that
make use of NEWNEWS.

> While the
> news server is searching this file for you, it isn't doing any work for other
> users.

This is not the case. Multiple nnrpds can run searches on the history database
at the same time. Considering that news servers frequently run 300+
simultaneous readers it would be a *real* problem if this was the case.

--
Simon Burr                             Work: simonb@uunet.pipex.com
Systems Engineering, UUNetPipex        Play: simes@bpfh.net

Re: NEWNEWS Command
#15025
Author: Hans J Jakobsen
Date: Thu, 13 Feb 1997 00:00
32 lines
2224 bytes
Simon Burr wrote:
> 
> Terry Kennedy wrote:
> >I use C News + the reference NNTP plus a bunch of local enhancements,
> >so I'm not entirely conversant with INN. However, in my environment an
> >ARTICLE command that specifies a Message-ID returns the article in
> >milliseconds.
> 
> The same is true for INN. The problems occur with INN since nnrpd starts
> to read the history database into memory to do this. So doing just one
> ARTICLE command with a Message-ID isn't going to hurt too much. Its when
> lots of ARTICLE commands using Message-IDs are used that problems start to
> occur. When this happens more and more of the history database is read
> into memory. As I said before, enough of these processes and a news server
> can quickly run itself into the ground. 
It is possible to tune this behaviour, see config.data:

##  How many Message-ID retrievals until nnrpd does a dbzincore?  Set
##  to -1 to never do incore.
#### =()<NNRP_DBZINCORE_DELAY           @<NNRP_DBZINCORE_DELAY>@>()=
NNRP_DBZINCORE_DELAY    40


-----------------------------------------------------------------------------
Tele Danmark Erhverv, Data Divisionen      TLF: +45 8945 8133
Hans J Jakobsen                            FAX: +45 8945 8108
Gunnar Clausens Vej 78                     X400:C=dk;admd=DK400;PRMD=DATACOM;
DK 8620 Viby J                                  S=Jakobsen;G=Hans
Danmark                                    Internet:hjj@datacom.dk400.dk

Re: NEWNEWS Command
#15033
Author: Forrest J. Cavalier III
Date: Thu, 13 Feb 1997 00:00
44 lines
2150 bytes
In article <87enekef7v.fsf@erlenstar.demon.co.uk>, andrew@erlenstar.demon.co.uk 
wrote...

>I've been taking a look at what suck-3.3.2 does, with a view to possibly
>diddling in it to make it faster (or even rewriting it from scratch), if

   --Them's fightin words, in some parts.

>I can do it in a way that doesn't make it *too* server-unfriendly.
>
   Hold on Clem, let him have his say before ya start a shootin.

>What I was thinking of doing was:
>
>  for each group
>    issue "GROUP name"
>    check article high number against config file
>    if any new articles
>      issue "XOVER range" for the new articles
>      add all received message-ids and article numbers to a list,
>        filtering on size, From, etc. if desired
>  remove duplicate message-ids
>  remove message-ids already in local history file
>  for each group
>    issue "GROUP name"
>    for each article number in list
>      issue "ARTICLE nnnn"
>    (doing this loop in a pipeline to eliminate turnaround latency)
>
>So, doing the actual article retrieval should be as efficient as possible.
>The XOVER involves transferring more data than the XHDR Message-ID, but 
>allows much more efficient filtering (especially on article size).

XHDR alone gets you Message-ID to article number mapping.  XOVER the
rest if you need it for filtering.

Forrest Cavalier
Mib Software
(Just what Usenet needs... suck with table manners.  It still might
eat you out of house and home, but now it will say grace first.)


Re: NEWNEWS Command
#15034
Author: Evan Champion
Date: Thu, 13 Feb 1997 00:00
17 lines
1437 bytes
Egil Kvaleberg wrote:
> Reading in the straight ahead manner (full article by number) will
> definitely give the best overall performance as well as minimum server
> load.

This assumes that you are using a traditional store-by-article-number 
news spool.  In all the proposed new spool structures (mostly variations 
on store-by-hashed-message-ID or circular buffers, etc.), it is almost 
certainly faster to retrieve by message ID.  In fact, for anything but 
store-by-article-number, article numbers are artifical (in that they 
don't represent anything physical) and are a waste of effort for the 
server to create.

Evan

Re: NEWNEWS Command
#15035
Author: Egil Kvaleberg
Date: Thu, 13 Feb 1997 00:00
36 lines
2231 bytes
On Wed, 12 Feb 1997, Simon Burr wrote:

> When I did some work in this area about a year ago, I found that the NEWNEWS
> command itself didn't impact performance that much. It was when the client
> started issuing requests for articles by Message-ID that the problems started.

NEWNEWS definitely gives the INN server a real blow in the face. A NEWNEWS
request for even a moderate number of newsgroups will load any newsserver
heavily for many seconds, even minutes. In addition to hurting other
users, it even hurts performance for the user who issues NEWNEWS since the
time taken for the NEWNEWS to respond usually amounts to a significant
part of the actual transfer time. 

But you are right: Reading by Message-ID is slower too, as is reading the 
articles by HEAD first, then BODY.

Reading in the straight ahead manner (full article by number) will
definitely give the best overall performance as well as minimum server
load. Even compared to methods that involve automated spam kill mechanisms
in the transfer process, since these all involve doing things that hurt
performance and increases server load. If you want to do automated spam
killing etc., it is better to do this *after* the articles have been
transferred. (All this assuming that spam that can be auto-killed is
limited to, say, 20%)

Egil

See also: http://home.sn.no/home/newsx.html
-- 
Email: egilk@sn.no  Voice: +47 22523641, 92022780 Fax: +47 22525899
Snail: Egil Kvaleberg, Husebybakken 14A, 0379 Oslo, Norway
URL:   http://home.sn.no/home/egilk/


Re: NEWNEWS Command
#15039
Author: Andrew Gierth
Date: Thu, 13 Feb 1997 00:00
66 lines
3108 bytes
>>>>> "Egil" == Egil Kvaleberg <egilk@sn.no> writes:

 Egil> But you are right: Reading by Message-ID is slower too, as is
 Egil> reading the articles by HEAD first, then BODY.

 Egil> Reading in the straight ahead manner (full article by number)
 Egil> will definitely give the best overall performance as well as
 Egil> minimum server load. Even compared to methods that involve
 Egil> automated spam kill mechanisms in the transfer process, since
 Egil> these all involve doing things that hurt performance and
 Egil> increases server load. [...]

I've been taking a look at what suck-3.3.2 does, with a view to possibly
diddling in it to make it faster (or even rewriting it from scratch), if
I can do it in a way that doesn't make it *too* server-unfriendly.

What it currently does is:

  for each group
    issue "GROUP name"
    check article high number against config file
    if any new articles
      issue "XHDR Message-ID range" for the new articles
      add all received message-ids to a list
  remove duplicate message-ids
  remove message-ids already in local history file
  if killfile
    for each message-id
      issue "HEAD <message-id>"
      if article not killed
        issue "BODY <message-id>"
  else
    for each message-id
      issue "ARTICLE <message-id>"

What I was thinking of doing was:

  for each group
    issue "GROUP name"
    check article high number against config file
    if any new articles
      issue "XOVER range" for the new articles
      add all received message-ids and article numbers to a list,
        filtering on size, From, etc. if desired
  remove duplicate message-ids
  remove message-ids already in local history file
  for each group
    issue "GROUP name"
    for each article number in list
      issue "ARTICLE nnnn"
    (doing this loop in a pipeline to eliminate turnaround latency)

So, doing the actual article retrieval should be as efficient as possible.
The XOVER involves transferring more data than the XHDR Message-ID, but 
allows much more efficient filtering (especially on article size).

Any comments? Is this likely to be much of an improvement?
    
(Also, I don't like suck's arrangement of writing separate files for the
downloaded articles.)

-- 
Andrew.

Re: NEWNEWS Command
#15048
Author: Andrew Gierth
Date: Fri, 14 Feb 1997 00:00
30 lines
1769 bytes
>>>>> "Goran" == Goran Larsson <hoh@approve.se.NO_JUNK_EMAIL> writes:

 Goran> As a former suck user with similar views, I suggest you look
 Goran> at NewsX unless you absolutely must write something new.

Too late :-)

(Actually, all I've done is whomp up a prototype version in Perl, more
as an exercise in Perl programming than anything else - I only started
playing with Perl a couple of days ago)

 Goran> The switch from suck to NewsX doubled the effective transfer
 Goran> speed for me. YMMV depending on the news server.

My version also did that. My guess is that it's the pipelining that's
responsible, rather than the precise nature of the commands sent to
the server.

 Goran> This is also one of my gripes about suck. NewsX, on the other
 Goran> hand, creates the batch file directly in the CNews or INN
 Goran> input directory.

I made my version write straight into a pipe to rnews - seemed the
simplest method :-)

-- 
Andrew.

Re: NEWNEWS Command
#15050
Author: Egil Kvaleberg
Date: Fri, 14 Feb 1997 00:00
34 lines
1844 bytes
On Thu, 13 Feb 1997, Evan Champion wrote:

> Egil Kvaleberg wrote:
> > Reading in the straight ahead manner (full article by number) will
> > definitely give the best overall performance as well as minimum server
> > load.
> 
> This assumes that you are using a traditional store-by-article-number 
> news spool.

Certainly. I was referring to *existing* servers that I know about, and 
which account for the vast majority of installations AFAIK.

> In fact, for anything but 
> store-by-article-number, article numbers are artifical (in that they 
> don't represent anything physical) and are a waste of effort for the 
> server to create.

Not so.

They DO represent something *very* useful: the sequence in which the
articles arrived at the server. As it happens, this make them a perfect
tool for determining exactly what articles you haven't seen yet. Which is
really the main point of news exchange anyway.

Egil
-- 
Email: egilk@sn.no  Voice: +47 22523641, 92022780 Fax: +47 22525899
Snail: Egil Kvaleberg, Husebybakken 14A, 0379 Oslo, Norway
URL:   http://home.sn.no/home/egilk/


Re: NEWNEWS Command
#15060
Author: Matt Dillon
Date: Fri, 14 Feb 1997 00:00
51 lines
2569 bytes
:In article <%Gz-AzgVcQ@big.thought>, Egil Kvaleberg  <egilk@sn.no> wrote:
:>On Thu, 13 Feb 1997, Evan Champion wrote:
:>
:>> Egil Kvaleberg wrote:
:>> > Reading in the straight ahead manner (full article by number) will
:>> > definitely give the best overall performance as well as minimum server
:>> > load.
:>> 
:>> This assumes that you are using a traditional store-by-article-number 
:>> news spool.
:>
:>Certainly. I was referring to *existing* servers that I know about, and 
:>which account for the vast majority of installations AFAIK.
:>
:>> In fact, for anything but 
:>> store-by-article-number, article numbers are artifical (in that they 
:>> don't represent anything physical) and are a waste of effort for the 
:>> server to create.
:>
:>Not so.
:>
:>They DO represent something *very* useful: the sequence in which the
:>articles arrived at the server. As it happens, this make them a perfect
:>tool for determining exactly what articles you haven't seen yet. Which is
:>really the main point of news exchange anyway.
:>
:>Egil
:>-- 
:>Email: egilk@sn.no  Voice: +47 22523641, 92022780 Fax: +47 22525899
:>Snail: Egil Kvaleberg, Husebybakken 14A, 0379 Oslo, Norway
:>URL:   http://home.sn.no/home/egilk/

    You guys are talking about apples and oranges... it depends on 
    your point of view.  Article numbers are meaningless to news TRANSIT
    sites (i.e. the 'backbone'), but meaningful to leaf nodes which
    have newsreaders.

    Newer spool designs are doing away with the actual storage of
    articles by group and article number and instead storing them
    by message-id, by message-id and time-received, or by message-id
    and estimated-expiration.  In this case, the article numbers
    and group names are only tangible to the newsreader, and then
    only through translation.  The 'rest of the system' would work 
    entirely with message-id's.

					-Matt



Re: NEWNEWS Command
#15062
Author: Goran Larsson
Date: Fri, 14 Feb 1997 00:00
38 lines
1982 bytes
In article <87enekef7v.fsf@erlenstar.demon.co.uk>,
Andrew Gierth  <andrew@erlenstar.demon.co.uk> wrote:

> I've been taking a look at what suck-3.3.2 does, with a view to possibly
 . . .
>     for each message-id
>       issue "ARTICLE <message-id>"

> What I was thinking of doing was:
 . . .
>     for each article number in list
>       issue "ARTICLE nnnn"

As a former suck user with similar views, I suggest you look at NewsX
unless you absolutely must write something new.

NewsX can be found at
	http://home.sn.no/~egilk
	ftp://ftp.sn.no/user/egilk

> Any comments? Is this likely to be much of an improvement?

The switch from suck to NewsX doubled the effective transfer speed
for me. YMMV depending on the news server.

> (Also, I don't like suck's arrangement of writing separate files for the
> downloaded articles.)

This is also one of my gripes about suck. NewsX, on the other hand,
creates the batch file directly in the CNews or INN input directory.

-- 
 Goran Larsson                mailto:hoh @ approve . se
 I was an atheist,            http://home1.swipnet . se/%7Ew-12153/
 until I found out I was God.

Re: NEWNEWS Command
#15132
Author: Egil Kvaleberg
Date: Tue, 18 Feb 1997 00:00
24 lines
1422 bytes
On 14 Feb 1997, Andrew Gierth wrote:

> My version also did that. My guess is that it's the pipelining that's
> responsible, rather than the precise nature of the commands sent to
> the server.

You're right about the importance of pipelining, but actual server load 
should also be considered. Although it may not always influence transfer 
dramatically. We are all responsible citizens, aren't we ;-)
 
> I made my version write straight into a pipe to rnews - seemed the
> simplest method :-)

The option is --rnews for the very latest NewsX version.

Egil
-- 
Email: egilk@sn.no  Voice: +47 22523641, 92022780 Fax: +47 22525899
Snail: Egil Kvaleberg, Husebybakken 14A, 0379 Oslo, Norway
URL:   http://home.sn.no/home/egilk/	    PGP: finger:egilk@sn.no


Re: NEWNEWS Command
#15142
Author: bill davidsen
Date: Tue, 18 Feb 1997 00:00
47 lines
2869 bytes
In article <E5GFKo.Goz@spcuna.spc.edu>,
Terry Kennedy  <terry@spcuna.spc.edu> wrote:
| David A. Bartizal <dabart1@solution4u.com> writes:

| > 2. Why is the NEWNEWS command being phased out. It seems like a good
| > method to issue one simple command? There *must* be some better way,
| > eh?
| 
|   A long time ago, Usenet news was low volume - I remember when a one month
| article retention would happily fit in 500MB. These days, news is several
| GB per day. While a lot of that is people distributing pirated software and
| dirty pictures, a lot of it is just an increased quantity of articles.
| 
|   All of the common news transports NEWNEWS commands do a search through the
| news "history file". This file has grown in step with the number of articles
| and can now be quite large (on one of my servers it's > 150MB). While the
| news server is searching this file for you, it isn't doing any work for other
| users.

I always wondered why this command is so _slow_? My history file is
about 2.5M lines, so the binary search used in INN would take ~22
disk accesses to find the starting point. Now, if the NEWNEWS output
is huge, and being sent over a slow link like a modem, it could take
a long time to send. But the actual case is that the search is the
time consuming part, with a huge delay before the article list
starts to flow.
| 
|   There are a number of ways to get equivalent info. Which is best probably
| depends on which server your ISP is running.
| 
|   You can do a "list active" or a "group group.name" to get the current low
| and high article numbers in the groups (the first form gives you the info for
| all the group, the second for a specific group).

Assuming that you get all your feed from a single server, you can
save the highest article number. But if you get feeds from many
places, you probably need to use XOVER and check the article
numbers. In either case the NEWNEWS is not needed.
--
  bill davidsen <davidsen@tmr.com>
Some people hack for fun, some because they want things their way,
some don't because they can't, and some because they can't be
bothered. Some can make anything work, some can but would rather
not, and some could misconfigure a bowling ball.

Re: NEWNEWS Command
#15149
Author: bill davidsen
Date: Tue, 18 Feb 1997 00:00
20 lines
1491 bytes
In article <87enekef7v.fsf@erlenstar.demon.co.uk>,
Andrew Gierth  <andrew@erlenstar.demon.co.uk> wrote:

| So, doing the actual article retrieval should be as efficient as possible.
| The XOVER involves transferring more data than the XHDR Message-ID, but 
| allows much more efficient filtering (especially on article size).
| 
| Any comments? Is this likely to be much of an improvement?

The XOVER command is likely to be low overhead if NOV is running, if
not the XHDR command will beat the disk to death anyway.
--
  bill davidsen <davidsen@tmr.com>
Some people hack for fun, some because they want things their way,
some don't because they can't, and some because they can't be
bothered. Some can make anything work, some can but would rather
not, and some could misconfigure a bowling ball.

Re: NEWNEWS Command
#15175
Author: James Brister
Date: Wed, 19 Feb 1997 00:00
17 lines
1148 bytes
davidsen@tmr.com (bill davidsen) writes:

> I always wondered why this command is so _slow_? My history file is
> about 2.5M lines, so the binary search used in INN would take ~22
> disk accesses to find the starting point.

Actually it's worse than that -- it does the binary search by byte counts,
not line counts. For an average line length of about 80 characters, you'd
be looking at about 27 disk accesses.

James
-- 
James Brister                                            brister@vix.com
Internet Software Consortium    http://www.isc.org/isc   inn@isc.org 

Re: NEWNEWS Command
#15181
Author: bill davidsen
Date: Thu, 20 Feb 1997 00:00
28 lines
1861 bytes
In article <yy3u3n8ikex.fsf@velo.pp.vix.com>,
James Brister  <brister@vix.com> wrote:
| davidsen@tmr.com (bill davidsen) writes:
| 
| > I always wondered why this command is so _slow_? My history file is
| > about 2.5M lines, so the binary search used in INN would take ~22
| > disk accesses to find the starting point.
| 
| Actually it's worse than that -- it does the binary search by byte counts,
| not line counts. For an average line length of about 80 characters, you'd
| be looking at about 27 disk accesses.

Sure, but reading BUFSIZE bytes at a time and scanning forward for
the newline, the whole selected line should be in memory.

More to the point, 22, 27, whatever accesses should not take 50-100
sec to start sending data, no matter what the actual small number.
It was so slow I had to look at the code to be sure it wasn't
scanning with a linear search!
--
  bill davidsen <davidsen@tmr.com>
Some people hack for fun, some because they want things their way,
some don't because they can't, and some because they can't be
bothered. Some can make anything work, some can but would rather
not, and some could misconfigure a bowling ball.

Re: NEWNEWS Command
#15262
Author: Per Hedeland
Date: Sun, 23 Feb 1997 00:00
42 lines
2645 bytes
In article <5ecv0q$1bcm@usenet1y.prodigy.net> davidsen@tmr.com (bill
davidsen) writes:
>I always wondered why this command is so _slow_? My history file is
>about 2.5M lines, so the binary search used in INN would take ~22
>disk accesses to find the starting point. Now, if the NEWNEWS output
>is huge, and being sent over a slow link like a modem, it could take
>a long time to send. But the actual case is that the search is the
>time consuming part, with a huge delay before the article list
>starts to flow.

Well, I did a trace on an nnrpd running NEWNEWS, and the binary search
was indeed very fast - ~ 1 second and 15 reads to find the starting
point in a 170 MB history file. The time-consuming part was scanning all
the subsequent lines for matches, and the nnrpd seemed mostly CPU-bound
during this time. The delay in the start of the article list is probably
due to stdio buffering.

Thus the time used depends mostly on how long has passed since the time
given in the NEWNEWS command - my history seems to have some 100 bytes
per entry, i.e. if you receive 200k articles/day a NEWNEWS-user
connecting once/day would have to search through some 20 MB of data.
Things get worse if they specify a distribution pattern of course (I
didn't in the above test), as nnrpd will then have to open each
newsgroup-matching article, extract the distribution from it, and (if
any) check if it matches.

The case of the newsgroup-pattern being '*' is specifically recognized
as obviating the need to do newsgroup matching, so using it should be
faster (and in general a single NEWNEWS with a complex pattern should be
much better than multiple ones with simple patterns), but I couldn't
verify this as another "optimization":

    /* Optimization in case client asks for !* (no groups) */

new in INN 1.5, makes nnrpd core dump if you ask for '*'.:-) (I would
think the case this new optimization caters to is utterly rare...:-)

--Per Hedeland
per@erix.ericsson.se

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