🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
6 messages
6 total messages Started by Steve Day Fri, 19 Sep 1997 00:00
A history file question.
#21699
Author: Steve Day
Date: Fri, 19 Sep 1997 00:00
26 lines
1428 bytes
   I am running inn-1.5.1 on a Sparc 20/50 with Sunos version 4.1.3_U1. 
After a history rebuild, the history.dir file will be somewhere around 63 
bytes. Over a period of time this number will increase to 123. Once it 
gets to 123, it stays there and there seems to be about a 10% drop in 
performance. The size of history.pag remains the same until the .dir file 
hits 123 bytes. The history.pag file then starts increasing in size.

   If I run fixhist and the makehistory -r -s "line count" then the 
process starts all over again.

   It worked the same way when I was running inn-1.4.

   Is this normal, or is there a problem that can be corrected? I am 
having to run fixhist about every two weeks to keep the performance up.

   The dbz.* I am using are the ones that are supplied with INN.

   Any suggestions would be appreciated.

Thanks

Steve Day - sad001 AT ccnet.com


Re: A history file question.
#21793
Author: Olaf Titz
Date: Tue, 23 Sep 1997 00:00
80 lines
4795 bytes
Steve Day  <sad001@no-stinking-spam.com> wrote:
> After a history rebuild, the history.dir file will be somewhere around 63 
> bytes. Over a period of time this number will increase to 123. Once it 
> gets to 123, it stays there and there seems to be about a 10% drop in 
> performance. The size of history.pag remains the same until the .dir file 
> hits 123 bytes. The history.pag file then starts increasing in size.

Hint: if history.pag grows you have trouble.

In detail: "cat" the history.dir file. It consists of two(*) lines of
text like this:
dbz 3 617647 9 C 32 31 26 4 3 2 1 0
336602 340958 359137 377054 388899 384884 390261 359715 343472 363304 411748

(*) Some versions of dbz use three lines, not relevant here

The third field in the first line tells how many entries the hash
table has. The first field in the second line tells how many of them
are actually in use (i.e. the number of lines in the history).
For optimum performance, no more than about 70% of the slots should be 
in use, or else the collision rate goes up and history lookups take
more time. In the above example: 336602/617647 is about 0.54, far on
the safe side.

The rest of the second line is a "history" of the used size. On each
history rebuild (i.e. expire run), the second line is shifted right
one entry and the new size added to the left. The process takes the
maximum of those numbers to determine how big the hash table should
get. This way the history file may grow and shrink a bit due to
varying volume without the hash table suddenly becoming too small.

Resizing the hash table while running is impossible. If too many
collisions occur (more precisely: if a lookup yields more than 10 used
slots before finding a free one), dbz adds a second hash table which
is used after the first one is exhausted. The hash table is the
history.pag file. So when the history.pag file grows, you have history
lookups taking more than _ten_ string comparisons and associated file
reads, as opposed to _one_ in the normal case. No wonder the whole
thing gets slow.

>    If I run fixhist and the makehistory -r -s "line count" then the 
> process starts all over again.
>    Is this normal, or is there a problem that can be corrected? I am 
> having to run fixhist about every two weeks to keep the performance up.

With makehistory, a new hash table is started from scratch. In this
case the info on how many entries were used in the past is not
preserved and the second line is filled with zeros after the first
(big) number. This is the reason why the history.dir file, while
remaining small, keeps growing a bit (for the first 10 days after a
makehistory run, actually).

The symptoms you describe all point to an expire process not working
correctly. For troubleshooting, do the following: when performance
starts degrading, look at the second line in the history.dir file. The
numbers usually should go up and down, reflecting varying history
sizes. If, however, you see a monotonic decreasing(*) sequence, this
means your history file is growing steadily and not getting cut back
by expire. It deletes articles (or else your spool disk would explode
;-) but it doesn't delete history entries. Likely reason: too little
disk space while running expire. The new history can't be written, and 
the old one is re-used. (Until manual fixhist cuts it back.)

(*) as described above, the sequence is filled in from right to left

So to make a long story short: Make sure in your NEWSCTL there is
always enough space for _two_ copies of the whole history file. Or
give the "expdir=DIR" argument to news.daily, where DIR is on a disk
that has enough space for another history file. If that was not the
reason, perhaps the above contains enough hints do dig further anyway.

olaf
-- 
___        Olaf.Titz@inka.de or @{stud,informatik}.uni-karlsruhe.de       ____
__ o           <URL:http://www.inka.de/~bigred/>     <IRC:praetorius>
__/<_              >> Just as long as the wheels keep on turning round
_)>(_)______________ I will live for the groove 'til the sun goes down << ____

Re: A history file question.
#21863
Author: Ron Echeverri
Date: Thu, 25 Sep 1997 00:00
15 lines
1100 bytes
In article <60f24a$2op@lovecraft.nwnet.net>,
Anthony Talltree <aad@nwnet.net> wrote:
>>Once you have the history file sorted, the following awk will help:
>Um, why not just use uniq(1)?

Or 'sort -u'...

rone
-- 
Ron Echeverri		<URL:http://www.ennui.org/~rone/>	<rone@best.net>
Systems/Usenet Administration			  "This is _my_ ISP, _i_ do the
Best Internet Communications, Inc.	     ass-kicking around here!" -rpwhite

Re: A history file question.
#21866
Author: Anthony Talltree
Date: Thu, 25 Sep 1997 00:00
29 lines
983 bytes
>Once you have the history file sorted, the following awk will help:

Um, why not just use uniq(1)?

>BEGIN {
>        LINE = "";
>}
>{
>        if (LINE != $1)  {
>                print $0
>                LINE = $1
>        } else {
>                print $0 >> "history.dups"
>        }
>}












Re: A history file question.
#21888
Author: Frank Durda IV
Date: Thu, 25 Sep 1997 00:00
75 lines
4225 bytes
Steve Day wrote:
>    I am running inn-1.5.1 on a Sparc 20/50 with Sunos version 4.1.3_U1.
> After a history rebuild, the history.dir file will be somewhere around 63
> bytes. Over a period of time this number will increase to 123. Once it
> gets to 123, it stays there and there seems to be about a 10% drop in
> performance. The size of history.pag remains the same until the .dir file
> hits 123 bytes. The history.pag file then starts increasing in size.


There is a bug in 1.5x and 1.6x that causes the history.pag file to double
or triple (or more) in size, particularly on sites where INND actually
receives multiple overlapping feeds.   The problem does not occur in 1.4.x.

As an example, our .pag file would start out (once cleaned of trash) at
a directory size (ls -al) of about 120Meg.  Within a day, it would be
500Meg. At this point, the flat history file was about 390 to 420Meg!
Eventually INND would core dump when it tried to grow the history.pag
file to over 1GB in size and exceeded the memory limit of 900Meg we
set for INND.  The flat file is still under 420Meg.  This takes as
little as 10 additional hours, leaving a .pag file several times larger
than the flat history file.  Very reproducible.

I am talking about the size of history.pag becoming insane, not
the various memory leaks in innd that make INND grow when it discards
duplicates and also eventually kills it.  That's a different bug.

To see if you are afflicted by the oversized history.pag file, take the
flat history file, sort it, and see how many duplicate Message-ID entries
you have in there.  There should be zero.  With 1.5 and 1.6, there will
be duplicates due to the bug.  Before we took action on our systems, we
measured duplicates being inserted into the history database at rates of
thousands per hour.  DBZ doesn't take kindly to its callers giving it
duplicate records, and tends to split database trees to cope with the
collision rate (you have collisions when you stuff the exact same ID
in there), causing the history.pag file size to grow insanely large.

Once you have the history file sorted, the following awk will help:

BEGIN {
        LINE = "";
}
{
        if (LINE != $1)  {
                print $0
                LINE = $1
        } else {
                print $0 >> "history.dups"
        }
}


One easy "fix" is to firewall your INND box with a Diablo or similar
package, allowing only one feed into your INND system. This also reduces
the INND memory leaks considerably, although you will still manage
to have a few duplicates added per hour. 

I note we have had 1349 duplicate history database write attempts on our
system that we caught today, or about 74/hour, and that is with only two
feeds reaching the INND box.

By the way, those 1349 duplicates were counted at the HISwrite call,
long after duplicates should have been caught at higher levels.  Dbz.c
does not check to see if the caller is doing something stupid.  There is
some code that appeared in 1.5.x that doesn't check before it writes to
the  database.   That code is also in 1.6.   Bad code, no biscuit. 


Frank Durda IV - only these addresses work:|"The Knights who say "LETNi"
   <uhclem.ds3%nemesis.lonestar.org>       | demand... A SEGMENT REGISTER!!!"
or <uhclem.ds3%rwsystr.nkn.net>            |"A what?"
These Anti-spam addresses expire Oct. 15th |"LETNi! LETNi! LETNi!" - 1983
(c) 1997, ask before printing.

Re: A history file question.
#21920
Author: coneill
Date: Fri, 26 Sep 1997 00:00
34 lines
1998 bytes
drechsau@yuck.net (Mike Horwath) writes:
> Frank Durda IV <uhclem.ds3@nemesis.lonestar.org> wrote:
> : One easy "fix" is to firewall your INND box with a Diablo or similar
> : package, allowing only one feed into your INND system. This also reduces
> : the INND memory leaks considerably, although you will still manage
> : to have a few duplicates added per hour. 
> 
> Huh?
> 
> Firewall it because you have too many feeds?
> 
> How about editing your hosts.nntp file and removing those people you
> don't wanna receive feeds from anymore.
> 
> Easier (infinitely) and faster to administer than a firewall.
> 
> : I note we have had 1349 duplicate history database write attempts on our
> : system that we caught today, or about 74/hour, and that is with only two
> : feeds reaching the INND box.
> 
> Maybe your INN is broked and you need a fix.
> 
> I sure as hell don't have this problem.
> 
> Then again, I don't try to play the INN of the month game.

1.5* and 1.6* both have this bug.  The problem only occurs if you have
REMEMBER_TRASH set to DO, but if you do, you will see duplicates.  I
had to fix the problem in art.c when I committed my latest history
code because the new code fixes a long standing bug in dbz.
Previously dbz did not check for duplicate history entries.

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