Article View: news.software.nntp
Article #18928Re: The Incredible Expanding History File Problem
From: Net Scum
Date: Wed, 02 Jul 1997 00:00
Date: Wed, 02 Jul 1997 00:00
224 lines
12847 bytes
12847 bytes
On 30 Jun 1997, Joe Greco wrote:
> :A reader site which accepts articles older than the remember time runs a
> :risk of duplicated articles.
>
> What's criminal is if you haven't lowered your "c" parameter from 14.
> Otherwise what you're describing shouldn't happen.
Actually, no matter what I do, I'm going to have a problem until *all*
sites drop articles more than, say, a week old. Even today, I'll still be
seeing fresh articles disgorged from some far reaches, that have been
sitting idly, festering for more than a week before making it into the
mainstream. Certain schools in the southeastern US seem to have a problem
here in particular, and while pretty much all of us would agree that a
site has a problem if it can't get its posts into the backbone within a
few minutes, it happens.
(Rummages around under the desk to see if INN writes history entries
for articles too old, when one is configured to remember trash...) The
criminal thing in this part of the world is the bandwidth taken to
transfer an article needlessly. I'm running pretty much at 100% of line
capacity outgoing, but nearly all of this is to destinations in this
country, over fast connections with available capacity. However, it's the
incoming bandwidth that is limited to me. Whether an article passes
through my server with shortened remember time a second time, or is sent
to me to be tossed away after receipt, the big damage is the use of the
bandwidth. So long as any peer has articles older than a week, the only
solution for me is to hold the message IDs longer. Or relocate somewhere
that some 100 000 rejected articles daily (particularly the large binaries
that take time to propagate around to some of my peers) isn't so painful.
So my ideal solution would be to have a sufficiently long remember
time so as to be able to refuse articles that can still be found in
transit somewhere (which, given the default, would be two weeks), and a
cutoff to match some general consensus as to when an article can no longer
be considered particularly useful. Most of what I'm hearing seems to
center around a one week cutoff.
> :The .pag BDZ database [size...]
> :(and also depends on the number of bits used as index into this
> :file),
>
> No, unless that's a sly reference to a 64-bit DBZ variant, but in either
> case, the size is mainly a factor of #entries.
Gosh darnit, you can see right through me. Put them X-Ray Infra-
Red Herring Specs away right now, thank you. From what I've gathered from
the source, a suitably appropriate random prime number is carefully
chosen, roughly 50% larger than the number of entries in the history file
(these two numbers can be seen in the following sample atypical 32-bit
history.dir file:
dbz 3 7367639 9 C 4 3 29 4 0 1 2 3
4660771 4315890 4519779 4331113 4472988 4911755 4541803 4433979 4401256
^^^^^^^present number of entries
^^^^^^^top line; appropriately calculated prime
No more need to spend minutes waiting for a wc -l history to complete...)
Then, the .pag file is created at a size in bits equal to this prime
number, multiplied by the number of bits -- typically 32, but with your
hackery, 64. As most versions of `ls' show sizes in 8-bit bytes, the
actual size of the .pag file will be 4 times the chosen prime normally,
or twice this size with the Improved DBZ.
Now, the exact principles behind this, as well as the effects of
larger or smaller primes on the efficiency of the database or lookups, is
beyond me, and could easily be the subject of a book, or at least a
chapter of one about INN. But I digress.
> If history text lookups are a bottleneck for you, my opinion is that
> something's probably wrong. I've run 20,000 lookups per 300 second period
> without killing my I/O subsystems here, and that's in production, and
> without Clayton's code, which I haven't had time to play with.
But that's also with your 64-bit indexing, I hope, since that's your
handiwork. If I recall vaguely your words from the middle of December of
last year, you said that were I to stop being lazy and do the math, I'd
see collisions with 64-bit indexing on the order of one or two per year.
My eyes glazed over, I started drooling uncontrollably, and I haven't been
the same since.
Now, (hmm, thinks, scratches numbers with felt tip marker on back of
head) your 20 000 lookups in 300 seconds comes to some 2 million lookups
in 30 000 seconds, or some 6 million lookups in 90 000 seconds. I'll call
that a day. That's close to what I've seen. The difference, though, is
that your 20 000 lookups, minus, say 3000 articles not in history at ten
articles per second, comes to 17 000 hits to the text file. 17 001, if
you're unlucky and you've hit your yearly collision. And a good deal of
these are going to be in the disk cache. Assuming I've got this straight.
Whereas I, since I have failed to have success so far with your
patchery, will have these 20 000-odd lookups that each must be verified
against the text file not once, but multiple times. And presumably, the
number of collisions goes up by a factor of two as one starts losing bits.
> As you approach 32, you're going to be doing more and more "false" lookups
> to resolve DBZ collisions. At 30 bits it's almost intolerable.
And only half as intolerable at 29 bits, which is where I imagine most
sites out there are today. Many of them are tempted to make things even
less intolerable, shrinking their history files.
> : For suffering admins such as myself, whose eyes sort
> :of glaze over when poring over the dbz code, we want numbers. Figures.
>
> What kind of numbers? Maybe I still have my modified DBZ around that
> originally gave me some of the numbers I had used to justify 64-bit DBZ.
Well, the sort of numbers that led you to claim you'd get collisions
with alarming infrequency with your 64-bit DBZ patchery. For example,
let's take the INN dbz code's default of 24 bits out of 32, that one gets
when starting fresh. That'll be optimal for a history file up to just
over 16M in size, and at the time of this original code, this was probably
the size of a typical site's history file, give or take a couple factors
of two.
Once the history file busts the 16M mark (probably about 8 hours at
today's rate), you'll need to makehistory (dbzfresh?) your database to nab
another bit. That'll last you another 8 hours until you hit the 33M mark,
and once more you need to grab a bit. So, from having 7 bits unused, in
just one day, you've dropped to 5 bits, or from 128 additional hints, down
to 32 additional hints.
With this background aside, then my question is, given a typical
message ID, and a <16M history file at INN's defaults, how many actual
hits to the text file are you going to be doing? Likewise, with a 300M
history file (29 bits + 2 bits for a hint). Assuming Murphy to be in full
effect, you're going to keep doing false lookups until you reach a hit, so
the actual number of slams on the disk will be less than the theoretical
maximum, although presumably at somewhat random places in the text file.
This probably also wipes out the advantage of the disk cache where you
know that your well-synchronized peers will be giving you IDs that will be
found near the end of your history text file.
By now, I'm even more confused than when I started, so I'd love to
find a good solid reference to how the DBZ stuff works that I can curl up
with.
Anyway, while I know that with the 64-bit indexing, I can count on
hitting the text file roughly once per message ID, I really have no idea
whether I'm hitting this file twice, five times, twenty times, a hundred
times, or what, for each message I'm offered. So that's what I'm asking.
Just how badly is the traditional history lookup affecting news
performance? How many theoretically unnecessary lookups am I making?
It would be just my luck if this data were in the idle timer patches
you kindly contributed, that I haven't yet installed...
> :Whatever it is, with an 80% busy history disk and a sluggish server, it's
> :time for me to apply more hackery.
>
> Or maybe it's time for you to get a second history disk to stripe with.
I'm in the same boat as you, only more so. Any additional hardware
for my news machines will come straight from my pocket, and with a gig of
decent disk storage costing a month's pay, I'll happily spend a month
hacking on code to squeeze more performance from the single news disk that
has been provided for my play. That's why I'm running the CNFS on that
disk, rather than striping over several disks I'd have to buy myself.
Plus, the increase in news traffic has pushed my servers to the point
where their intended use as graphics workstations is being severely
affected by the additional news load that's been freeloading for half a
year on them, and I'm fast wearing out my welcome to play with spare
cycles, magnetic patterns, and optical blips.
And it's very possible that the other disk activity is slowing things
down a bit. Not only does that disk serve history, but it also serves the
CNFS spool and innfeed backlog tapes, as well as news logs. However, just
a couple weeks ago this disk was running at 20 to 40% busy, and given the
optimizations to disk activity in the latest innfeed and cyclical spool,
my gut feeling is that history comprises the bulk of the disk activity.
Don't think I'm not dying to move history to a different disk, and with
adequate space too. (Not quite as much as my servers are dying, tho)
> FWIW, I haven't really devised any substantially-better-than-DBZ methods,
> although I have some ideas which could be used to reduce the requirements
> somewhat, although some big changes would be needed.
Your ideas are certainly interesting, as are the ideas in use behind
Maxwell's NNTPrelay and Matt Dillon's Diablo. You've made it clear that
regardless of the hashing one might use, one has to take into account the
possibility of collisions, and that's why even though you have one heck of
a 64-bit system, you still go to the text file. I've seen the numbers you
and Scott Fritchie have tossed around with MD5 hashes, and the number of
collisions with a typical history file's contents with different length
hashes, and those collisions aren't negligible.
On the other hand, without having studied the history files in use by
the other news routers, I don't know if they all need to perform the same
duty as does INN's history database, also serving readers. I'll let
someone else look at them for possible weaknesses in logic.
The other big problem with the large history file was hinted at
earlier by Chris Sedore (NNTPrelay). With INN's history files, one needs
at least as much space free somewhere as is devoured by the history files,
minus the amount of text file that arrives in the expiration interval.
With a 300M text file, I've gotta clear out any old files from a space
where I've scrounged up 300M free, else I'll run out of space for the new
history files. Then all relevant entries are copied from the old history
file to the new one. Still, a few hundred spare megs is not something to
sneeze at. Even if one has this space free (most of the time) in another
filesystem, it still takes a bit of time to copy the new file from one
filesystem to another, to say nothing of disk activity.
Some ``cyclical'' variant of the history file would be heavenly to
lots of sites, so that, as with the spool, new entries somehow overwrite
old ones. Just exactly how to implement such a thing, I wouldn't know.
Or, like you suggested, rotating smaller history files. All of which
require coding.
Ah well, now both of my servers are hosed. Time to figure out where
I'm going wrong in the 64-bit history code, sigh...
Barry Bouwsma, Radio Praha news disservice
Technical Details
Message-ID:
<Pine.LNX.3.96.970702120431.5427B-100000@marley.vszbr.cz>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<Pine.LNX.3.96.970630125250.2588A-100000@marley.vszbr.cz> <5p8c49$cjl$1@earth.execpc.com>Show Full Headers
Complete Article Headers
Message-ID: <Pine.LNX.3.96.970702120431.5427B-100000@marley.vszbr.cz> Subject: Re: The Incredible Expanding History File Problem Date: Wed, 02 Jul 1997 00:00:00 +0000 From: Net Scum <barry@bofh-cabal.vszbr.cz> References: <Pine.LNX.3.96.970630125250.2588A-100000@marley.vszbr.cz> <5p8c49$cjl$1@earth.execpc.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 254058609 X-Sender: barry@marley.vszbr.cz Organization: Putting News Servers Six Feet Under Reply-To: ag786@yfn.ysu.edu Newsgroups: news.software.nntp NNTP-Posting-User: barry