Article View: news.software.nntp
Article #5259How to do a better USENET file system
From: Brad Templeton
Date: Sun, 25 Feb 1996 00:00
Date: Sun, 25 Feb 1996 00:00
54 lines
3450 bytes
3450 bytes
It's not hard to do a more efficient USENET file system. You just take chunks of raw disk (block devices). You need a "free" list when it starts, but in truth once running there is no free list, just a list of the "oldest" (least desired) articles. When a new article (or article batch if you want to be real efficient) comes in, you scan the list of oldest articles for one near the end that is of similar or slightly larger size. You do some blocking to make this very likely to be an old article. And you then thwap your new article, or batch, down on top of that old article. A single seek and a single write call. Then you record the seek address in an overview/header database that you are building elsewhere, either on your raw disk or in the real filesystem. Big articles are the only problem, though there are enough of them that this will probably work if you are willing to block big articles to larger and larger blocksizes. That wastes an amount of disk, but the disk saving of the above scheme (which can probably block articles to within 16 bytes) is so immense that a little wastage on the big boys is no problem. Or, you can put big articles in the real filesys, or you can support non-contiguous big articles. Not exacty hard, but the above system is darn close to trivial. No free list. No expire. All the disk always used fully. Old articles disappear as new ones come in and over-write them. All articles written with a single seek and write, and read with a single seek and read, plus occasional block writes to the overview database. (With luck you can cache enough of that in ram so you write it out a block at a time or during idle periods on your disk at the end of batches. It's ok if you wait a few minutes before the article "appears" live. For the outgoing batches you don't need the overviews, you just write out a log file with message-ids and seek addresses, and let your feeder read that) Of course you have to write an NNTPD to read from this, and some debug tools to let people poke around articles manually. But you simply can't get any more efficient than this without going to some fancy caching. (With a fancy cache, you can try to group articles, so that you do only one seek and write for groups of articles, and quite possibly, also for feeding.) You can keep the "oldest" article list as a stream calculated as articles come in, or you can write a program that recalcs it at night so that you can tune parameters as you wish even after the fact. This system can never run out of disk space unless you allow mega-huge articles, it is always exactly full, but efficiently so. -- Brad Templeton, publisher, ClariNet Communications Corp. info@clari.net The net's #1 E-Newspaper (1,200,000 paid sbscrbrs.) http://www.clari.net/brad/
Technical Details
Message-ID:
<DnCo3D.Cz3@clarinet.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:
<Dn4HrC.KIx@twwells.com> <4gfi22$evb@news.inc.net> <Dn5KLH.Muy@twwells.com>Show Full Headers
Complete Article Headers
Message-ID: <DnCo3D.Cz3@clarinet.com> Subject: How to do a better USENET file system Date: Sun, 25 Feb 1996 00:00:00 +0000 From: brad@clarinet.com (Brad Templeton) References: <Dn4HrC.KIx@twwells.com> <4gfi22$evb@news.inc.net> <Dn5KLH.Muy@twwells.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: 141110428 Organization: ClariNet Communications Corp. Newsgroups: news.software.nntp