🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
11 messages
11 total messages Started by Ragnar Lonn Thu, 27 Mar 1997 00:00
Checking ihave/check response speed on a server
#16383
Author: Ragnar Lonn
Date: Thu, 27 Mar 1997 00:00
57 lines
2949 bytes
Hello,

I've written a small program that connects to a server's NNTP port
and issues a bunch of IHAVE or CHECK commands with fabricated
message-ids I'm pretty sure won't exist. It keeps track of how
much time is spent sending these commands, waiting for a (or
several) response/s, and how much time is spent getting the
response/s, then it quits without sending any articles.

I made this program to see how fast my newspeers responded to these 
commands as I have backlogs to some of them and I suspected the feeding 
didn't go well because they were slow in doing history lookups.

The only problem is that when I run my program, results show that
even my slowest peers seem able to do about 10 lookups per second
(and I have huge backlogs against these peers). So now I'm wondering
if there's something I didn't think about when writing this program.
What it does is the following:

1. Connect to a server
2. Send 50 CHECK commands in rapid succession (one write for
    (each line sent). 
3. Start a timer
4. Read and count response lines received until a total of
   50 lines have been received.
5. Stop the timer.
6. Calculate and display time averages etc.

Now, I thought step #2 might take enough time to foil the results
by having the responses buffer up before step #2 is finished but
that can't be it because when I timed step #2 it took about 6ms
to complete (on my side, the packets didn't reach their destination
in that time of course) and that was a very short time compared to
the several seconds needed to complete the whole operation.

I know this simple scheme is susceptible to RTT lag - it was very
obvious when I tried my program on local machines or machines to
which there are very few router hops (=good response times). But
I think that can be taken care of with some adjustments and more
CHECK's to average out things better.

Anyhow, can anyone see anything inherently wrong in this scheme,
or something I didn't think about?  I do also, by the way, get
almost ridiculously high values for CHECK-responses per second
when connecting to our local newsfeed machine which is an Ultra-
sparc running Diablo. It would be cool if it could actually do
700-800 history lookups per second with a dozen active feeds
but I'm somewhat suspicious of the results my program gives
me right now :-)

Regards,

  /Ragnar, Algonet


Re: Checking ihave/check response speed on a server
#16439
Author: Clayton O'Neill
Date: Fri, 28 Mar 1997 00:00
28 lines
2090 bytes
On 27 Mar 1997 21:36:52 GMT, Ragnar Lonn <prl@algonet.se> wrote:
>I've written a small program that connects to a server's NNTP port
>and issues a bunch of IHAVE or CHECK commands with fabricated
>message-ids I'm pretty sure won't exist. It keeps track of how
>much time is spent sending these commands, waiting for a (or
>several) response/s, and how much time is spent getting the
>response/s, then it quits without sending any articles.
[snip]
>Anyhow, can anyone see anything inherently wrong in this scheme,
>or something I didn't think about?  I do also, by the way, get
>almost ridiculously high values for CHECK-responses per second
>when connecting to our local newsfeed machine which is an Ultra-
>sparc running Diablo. It would be cool if it could actually do
>700-800 history lookups per second with a dozen active feeds
>but I'm somewhat suspicious of the results my program gives
>me right now :-)

I believe the problem is that you are doing lookups with bogus msg-ids.  The
problem being that history lookup hits and misses take different amounts of
time.  The reason being that history lookup hits have to also look in the
history test file, not just the dbz, to verify a hit.  Perhaps it would be
beneficial to incorporate a md5 of the message-id into the dbz value that is
returned on a lookup hit along with the offset.  I would be willing to trust
that w/o actually doing to text file lookup also.  Oh well, future project.


Re: Checking ihave/check response speed on a server
#16453
Author: Ed Klein
Date: Fri, 28 Mar 1997 00:00
66 lines
3100 bytes
In article <5hep9k$8a@epimetheus.algonet.se>, Ragnar Lonn wrote:
>
>I've written a small program that connects to a server's NNTP port
>and issues a bunch of IHAVE or CHECK commands with fabricated
>message-ids I'm pretty sure won't exist. It keeps track of how
>much time is spent sending these commands, waiting for a (or
>several) response/s, and how much time is spent getting the
>response/s, then it quits without sending any articles.

Cyclone comes with a similarly designed utility called "nntpTime"
which sends a bogus article (missing the newsgroup header) to the
other side, and reports the times to connect, return a banner,
respond to IHAVE and take in an article (of a specified size).

So from one of my hubs to another across our backbone (and 9 router
hops):

cam-news-hub1# ../tools/nntpTime -server cpk-news-hub1 -loop 50 -bytes 4000
DNS + Connect: 89 msec
Welcome Message: 18 msec
Average IHAVE Response (50 trys) : 22 msec
Average Article Response (50 x 4107 byte articles): 25 msec

Pretty good numbers.

>The only problem is that when I run my program, results show that
>even my slowest peers seem able to do about 10 lookups per second
>(and I have huge backlogs against these peers). So now I'm wondering
>if there's something I didn't think about when writing this program.

It's not the lookup which hurts sometimes:

cam-news-hub1# ../tools/nntpTime -server One.Of.My.Peers
DNS + Connect: 42 msec
Welcome Message: 122 msec
Average IHAVE Response (1 try) : 95 msec
Average Article Response (1 x 4107 byte articles): 580 msec

It _could_ be a network bandwidth problem, you
might think...

cam-news-hub1# ../tools/nntpTime -server One.Of.My.Peers -bytes 50000
DNS + Connect: 52 msec
Welcome Message: 362 msec
Average IHAVE Response (1 try) : 151 msec
Average Article Response (1 x 50107 byte articles): 1939 msec

...but it could be a disk IO problem.  Hard to
tell.  I suspect in this case, it's the disk, since
this site doesn't catch up at night when the net
is less busy.  Either way - it's the actual
article that's causing the slowness.

Hope this helps,

--Ed

==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==
Ed Klein                           Systems Management and Administration      
eklein@bbnplanet.com                   Network Services - Operations 
(301) 982-4600 ext 124 (vox)                BBN Corporation 
(301) 982-4605  (fax)                 Networking Geek/NewsOverLord 


Re: Checking ihave/check response speed on a server
#16463
Author: Ragnar Lonn
Date: Sat, 29 Mar 1997 00:00
21 lines
1389 bytes
In article <slrn5jm5js.97g.eklein@what.bbnplanet.com>, 
eklein@what.bbnplanet.com (Ed Klein) wrote:
>
>....but it could be a disk IO problem.  Hard to
>tell.  I suspect in this case, it's the disk, since
>this site doesn't catch up at night when the net
>is less busy.  Either way - it's the actual
>article that's causing the slowness.
>

Yeah people have made me realize it is probably more often a question
of disk or network I/O rather than e.g. history lookups that slow things
down (though sometimes that can be the problem too of course).

I'm going to write something similar to Cyclone's NNTPtime to check
this with my peers (because I don't suppose that program is freeware?)

  /Ragnar, Algonet

Re: Checking ihave/check response speed on a server
#16466
Author: Della Lu
Date: Sat, 29 Mar 1997 00:00
30 lines
2230 bytes
prl@algonet.se (Ragnar Lonn) writes:
> In article <wH0Dfe07vAE@hana.demon.co.uk>,
> Della Lu <dellalu@hana.demon.co.uk> wrote:
> >Producing an MD5 hash of a Message-ID on a 486-66 PC takes an average
> >of about 97 microseconds, which, when you are doing just a few hundred
> >lookups per second is insignificant.
> >A 32 bit CRC value has a 1 in 65536 (2^16) chance of a collision (using
> >the birthday attack) a 128 bit MD5 Digest has a 1 in 18446744073709551615
> 
> Doing a hundred lookups per second, that would mean a collision would
> occur every few billion years or so. I find that completely unacceptable ;)

I think you misunderstand what the poster was suggesting they do with the
digest. They were wanting to have the digest in the dbz which they could
use as an assurance that they have got the have a match so they need
do no extra checking (as INN checks now). If you used a 32 bit CRC and
had 2625000 Message-IDs (1 week) currently in the system then there could
be upto ~39 spurious matches for every good one in the database, whereas
using a 128 bit Message-ID there would have to be 737 thousand quadrillion
Message-IDs in the system before a similar situation happened.
A 32 bit hash would fail upto 5 times a day, a 128 bit hash would fail
on average every 130 billion years. The amount of articles does grow daily, 
so it might not last that long.

-- 
Della Lu


Re: Checking ihave/check response speed on a server
#16469
Author: Della Lu
Date: Sat, 29 Mar 1997 00:00
26 lines
1762 bytes
Olaf Titz <olaf@bigred.inka.de> writes:
> Clayton O'Neill <coneill@oneill.net> wrote:
> > time.  The reason being that history lookup hits have to also look in
> > the history test file, not just the dbz, to verify a hit.  Perhaps it
> > would be beneficial to incorporate a md5 of the message-id into the
> > dbz value that is returned on a lookup hit along with the offset.  I
> > would be willing to trust
> 
> MD5 is _much_ too slow for that purpose. A simple CRC would also give
> the needed protection against hash collisions, but I doubt even that's
> worth it.

Producing an MD5 hash of a Message-ID on a 486-66 PC takes an average
of about 97 microseconds, which, when you are doing just a few hundred
lookups per second is insignificant.
A 32 bit CRC value has a 1 in 65536 (2^16) chance of a collision (using
the birthday attack) a 128 bit MD5 Digest has a 1 in 18446744073709551615
(2^64) chance of collision. A 32 bit CRC would be a waste of time to
implement.

-- 
Della Lu


Re: Checking ihave/check response speed on a server
#16474
Author: Ragnar Lonn
Date: Sat, 29 Mar 1997 00:00
16 lines
1299 bytes
In article <wH0Dfe07vAE@hana.demon.co.uk>, Della Lu <dellalu@hana.demon.co.uk> 
wrote:
>
>Producing an MD5 hash of a Message-ID on a 486-66 PC takes an average
>of about 97 microseconds, which, when you are doing just a few hundred
>lookups per second is insignificant.
>A 32 bit CRC value has a 1 in 65536 (2^16) chance of a collision (using
>the birthday attack) a 128 bit MD5 Digest has a 1 in 18446744073709551615

Doing a hundred lookups per second, that would mean a collision would
occur every few billion years or so. I find that completely unacceptable ;)

  /Ragnar, Algonet

Re: Checking ihave/check response speed on a server
#16475
Author: Ragnar Lonn
Date: Sat, 29 Mar 1997 00:00
21 lines
1675 bytes
In article <IHxbFGM8vAE@hana.demon.co.uk>, Della Lu <dellalu@hana.demon.co.uk> 
wrote:
>A 32 bit hash would fail upto 5 times a day, a 128 bit hash would fail
>on average every 130 billion years. The amount of articles does grow daily, 
>so it might not last that long.
>

Ah, that sounds better. Of course, I don't think we need worry about the
first time an article will be missed because of a checksum collision here as 
the sun (not a computer, but the big, yellow thing in the sky during daytime)
will probably have gone supernova long before that happens and this means
the earth will have been made utterly uninhabitable if not destroyed. I guess
it is possible that future space colonies will maintain newsservers (ouch, 
the RTT delays they will get!  Multiple-channel feeding has a bright future!)
so maybe they would appreciate the forethought of course :-)

  /Ragnar, Algonet


Re: Checking ihave/check response speed on a server
#16479
Author: Ragnar Lonn
Date: Sat, 29 Mar 1997 00:00
21 lines
1557 bytes
In article <slrn5jo1j3.gct.coneill@blah.erols.com>, coneill@oneill.net 
(Clayton O'Neill) wrote:
>
>I believe the problem is that you are doing lookups with bogus msg-ids.  The
>problem being that history lookup hits and misses take different amounts of
>time.  The reason being that history lookup hits have to also look in the
>history test file, not just the dbz, to verify a hit.  Perhaps it would be
>beneficial to incorporate a md5 of the message-id into the dbz value that is
>returned on a lookup hit along with the offset.  I would be willing to trust
>that w/o actually doing to text file lookup also.  Oh well, future project.
>

Hmm...maybe I ought to use old (say 10 days or so) message-ids from
real articles instead?  As I don't send anything, it isn't likely to mess 
something up I think and it would generate lots of history hits instead
of misses like now. 

  /Ragnar, Algonet

Re: Checking ihave/check response speed on a server
#16482
Author: Per Hedeland
Date: Sat, 29 Mar 1997 00:00
32 lines
2142 bytes
[ Bogus Distribution: inet removed ]

In article <5hj5mb$7nu@epimetheus.algonet.se> prl@algonet.se (Ragnar
Lonn) writes:
>Yeah people have made me realize it is probably more often a question
>of disk or network I/O rather than e.g. history lookups that slow things
>down (though sometimes that can be the problem too of course).

On the INN server here where I have the "innd timer" patch installed,
whose performance may not be typical (but probably not unusual), writing
an article to spool takes on average at least 10 times as long as a
history lookup (~ 180 ms vs 16 ms). Of course with ~ 10 full incoming
feeds the functions would use an approximately equal amount of total
time, but doing *only* history lookups is probably not a useful basis
for measurement.

>I'm going to write something similar to Cyclone's NNTPtime to check
>this with my peers (because I don't suppose that program is freeware?)

If I understood the description right, that program did send articles,
but with missing Newsgroups: header, causing them to be rejected. Such
articles are obviously not written to spool and IIRC not written to disk
at all - I believe innd reads the entire article into memory before
writing it to disk (or rejecting it) - thus you'll still omit the spool
write time. Then again, sending bogus articles that are actually filed
in spool by the remote is decidedly unfriendly...

--Per Hedeland
per@erix.ericsson.se

Re: Checking ihave/check response speed on a server
#16496
Author: Ragnar Lonn
Date: Sun, 30 Mar 1997 00:00
34 lines
2213 bytes
In article <5hk864$k5b$1@news.du.etx.ericsson.se>, per@erix.ericsson.se (Per 
Hedeland) wrote:
>
>>I'm going to write something similar to Cyclone's NNTPtime to check
>>this with my peers (because I don't suppose that program is freeware?)
>
>If I understood the description right, that program did send articles,
>but with missing Newsgroups: header, causing them to be rejected. Such
>articles are obviously not written to spool and IIRC not written to disk
>at all - I believe innd reads the entire article into memory before
>writing it to disk (or rejecting it) - thus you'll still omit the spool
>write time. Then again, sending bogus articles that are actually filed
>in spool by the remote is decidedly unfriendly...

Maybe if the articles were distributed to alt.test and had an expiration
header set so that they would expire in five minutes?  :-)

Hmm...I could 'steal' some lines from one of my outgoing batchfiles
and let my own program feed these articles to the remote... but that'd
mean the program would have to *work*  of course ;)

The easiest thing to do really, should be to insert some timing code
into the feed program I use normally and compile a separate version
of this program, then 'steal' a batchfile and use it for testing. I'd have
to steal the file right when I intend to do the testing of course, so
the articles in it will be 'fresh'. Yeah, that sounds like a good idea
and not too hard to implement maybe.

  /Ragnar, Algonet



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