Article View: news.software.nntp
Article #18878Re: The Incredible Expanding History File Problem
From: Joe Greco
Date: Mon, 30 Jun 1997 00:00
Date: Mon, 30 Jun 1997 00:00
161 lines
8030 bytes
8030 bytes
In news.software.nntp article <Pine.LNX.3.96.970630125250.2588A-100000@marley.vszbr.cz>, ag786@yfn.ysu.edu wrote: :The conventional wisdom has been to try to maintain a history file for two :weeks, turning down anything older than that time. However, as a site :which can actually keep up with a full feed would be trying to write to a :file larger than half a gig with such a policy, a lot of sites have cut :back on the number of days. I'm limited by space to not much more than :300M, and over a couple months, I've had to drop the time I remember :history entries from 11 days down to yesterday's whacking to only seven :days. I haven't held more than 7 days in a long time. :A reader site which accepts articles older than the remember time runs a :risk of duplicated articles. In theory, my history file has the potential :of being twice the size it needs to be, if some of my peers barf up :week-old stale news that I've seen, but forgotten about. However, I'm :running this truncated history file on transfer machines, and it appears :that I get about 10% or less of a feed recycled with this shorter remember :time. For such transfer machines, it is the responsibility of the :downstream site to refuse recycled articles, so while it's not good, it's :not criminal either. What's criminal is if you haven't lowered your "c" parameter from 14. Otherwise what you're describing shouldn't happen. :The efficiency of a history lookup is also related to the size of the :history text file. (Forgive me if I err here, for I haven't found a good :explanation of how the history database works.) Not really, as in general you are only going to cache a small part of the history text file (unless you have gobs of RAM). I've always worked with the assumption that one WILL go to disk for a history text access, except for the last few thousand articles written, since those will tend to be in cache. That helps when you've got dozens of peers all feeding you up- to-date feeds. :The .pag BDZ database :file is created at a size which depends on the number of entries in the :text file Yes :(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. :but as the database entries are pointers to positions in the text :file, there need to be enough bits set aside to span all possible :positions in this file. That is, for my 300M history file, I need 29 :bits, which will hold me until my text file is just over half a gig in :size. If I were to shave my history text file down to less than 270M, :either by lopping off another day or two from my remember time, or by :handling fewer articles, 28 bits would suffice. If I've only got 28 bits :but my history file is larger than 270M, any entries after the 2^28th byte :must be looked up directly in the text file, and things go horribly :downhill for the average system. Hmmmm, well, sorta. :In the case of a history lookup, the DBZ match is advisory, and one must :be certain by actually looking into the text file to verify that an entry :is present. The additional bits not needed are used to store part of the :message ID. The more of a message ID can be stored, the less one needs to :grope through the text file. So, we have the situation where it's more :efficient to keep a smaller history text file, yet the traffic volume of :today makes that impossible. Reduce remember time and "c" param. I run with "3" on a top 25 news server. :This is the situation which Joe Greco's 64-bit history indexing patch is :supposed to help those admins for whom it works buy a bit of time; say, :another couple months the rate things are going. I'm not sure I agree... :However, as one adds :more peers, one needs to do more history text file lookups to verify that :an offered message really is there. This is what Clayton O'Neill's :history cache patch is designed to help, by storing recent entries for the :benefit of well-synchronized peers. 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 for suffering sites like myself, with 29 bits needed to store the :position in the text file, we're probably doing a lot of false lookups :into the text file, and a disk buffer cache can only help so much there, 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. :even though chances are any actual matches are going to be near the tail :of the history file. For suffering admins such as myself, whose eyes sort :of glaze over when poring over the dbz code, we want numbers. Figures. :Forms and shapes. 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. :My logs, before I started to run out of space to keep this info, would :show around 5 million messages being offered daily, and 10% of them :accepted, meaning I'm refusing some 4 million or so messages by virtue of :being in the history cache, or because I dug around in the text file until :I came up with a match. But what I'd like to know is, on average, for :each message I'm offered, with 29 bits recorded in the history.dir file to :play with, how many actual times am I banging on the text file with false :hits? That's a value that can be calculated (although when I did so, my "in real life" numbers were somewhat higher than expected, presumably I forgot to take some factor into account). :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. When newsfeeds.sol.net had 1xST31055N for history, I was seeing 10-15ms per history lookup on average. When I went to 2xST31055N, that dropped to a much more reasonable 2ms per history lookup. :I don't like the tens of thousands of :articles passing through my servers a second time, A solvable configuration problem. rc.news, FLAGS="[...] -c3" :I don't like the time :it takes to do the history lookups (my other server with an even smaller :history file and 1/8 the number of lookups daily is doing no better speed- :wise), More I/O can solve it. :I don't like that I'm constantly running out of space, And fortunately more I/O means more disk which means more space. :I don't like :life, Neither do I but that's not a problem I'll solve for you. :and I don't want to do the math if there's a way I can weasel a :better overview of the history lookups from someone more knowlegeable. What is it that you want to know? I may be one of the few parties responsible for any serious DBZ hacking in this decade, so I guess you should ask me. 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. ... JG
Technical Details
Message-ID:
<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-mailReferences:
<Pine.LNX.3.96.970630125250.2588A-100000@marley.vszbr.cz>Show Full Headers
Complete Article Headers
Message-ID: <5p8c49$cjl$1@earth.execpc.com> Subject: Re: The Incredible Expanding History File Problem Date: Mon, 30 Jun 1997 00:00:00 +0000 From: jgreco@ns.sol.net (Joe Greco) References: <Pine.LNX.3.96.970630125250.2588A-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-mail X-Deja-AN: 253626952 Sender: jgreco@earth.execpc.com Organization: sol.net Network Services - Milwaukee, WI Newsgroups: news.software.nntp