Article View: news.software.nntp
Article #18870The Incredible Expanding History File Problem
From: Net Scum
Date: Mon, 30 Jun 1997 00:00
Date: Mon, 30 Jun 1997 00:00
100 lines
6380 bytes
6380 bytes
As the daily news volume has easily broken the 600 000 article mark and shows no signs of letting up, not only has the number of cancel messages combined with traditional Unix filesystems been causing strain on a hefty number of news servers out there, but also I suspect the increase in size of the history file has been slowing things down for some. 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. 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. The size of the history text file depends on a number of things, from the obvious number of entries, to the length of the Message-ID header, and the path to the groups where the article is posted. My history text file is actually smaller than a conventional history file, as the article path is not stored as a directory path, but as a typically shorter file:offset combination. Other sites with the same number of history entries that fill 300M on my disk could easily have 400M or 500M sized history text files. 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.) The .pag BDZ database file is created at a size which depends on the number of entries in the text file (and also depends on the number of bits used as index into this file), 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. 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. 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. 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. 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, 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. 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? Whatever it is, with an 80% busy history disk and a sluggish server, it's time for me to apply more hackery. I don't like the tens of thousands of articles passing through my servers a second time, 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), I don't like that I'm constantly running out of space, I don't like life, 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. Thanks heaps, Barry Bouwsma, news admin for Radio Praha serving steaming slabs o' spam and gigabytes of gunk for the masses
Technical Details
Message-ID:
<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-mailShow Full Headers
Complete Article Headers
Message-ID: <Pine.LNX.3.96.970630125250.2588A-100000@marley.vszbr.cz> Subject: The Incredible Expanding History File Problem Date: Mon, 30 Jun 1997 00:00:00 +0000 From: Net Scum <barry@bofh-cabal.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: 253608701 X-Sender: barry@marley.vszbr.cz Organization: A Wretchedly-Installed InterNetNews Site Reply-To: ag786@yfn.ysu.edu Newsgroups: news.software.nntp NNTP-Posting-User: barry