Article View: news.software.nntp
Article #19034Re: Most efficient directory structure for news?
From: Matt Dillon
Date: Sun, 06 Jul 1997 00:00
Date: Sun, 06 Jul 1997 00:00
57 lines
3226 bytes
3226 bytes
:In article <5pn3ck$137s$1@node17.cwnet.frontiernet.net>,
:Dan Foster <dsf@node6.frontiernet.net> wrote:
:>If you had the chance to dump the one-article-per-file and
:>one-group-per-directory structure, and could use any type of structure...
:>what would the most efficient one be?
:>
:>Diablo has an interesting approach - it certainly looks reasonable.
:>
:>Not to trample on any feelings here :) - I'm sure research has been done
:>in this area by folks like filesystem gurus and the like... are there any
:>other, better ones?
Basically there are two main methodologies:
(a) multiple articles per file, then a time based expire
(b) 'one big partition' which is written sequentially an then rolls
over.
There is a serious problem with (b) in that you actually have to read/write
a cooked partition rather then simulate it with 'one big file'. Otherwise
you run afoul of internal filesytem serialization locks in the kernel.
Diablo uses approach (a). Basically Diablo creates one file per incoming
connection and writes all articles that come over that connection to
that one file. There is very little kernel contention and no explicit
locking required to allocate space because only one process is writing
any given file. The kernel still allocates space for the file
internally from the filesystem bitmap, of course, but it usually isn't
a bottleneck. As long as the software does not create too many files
(and Diablo doesn't), the namei cache will approach a 100% cache hit ratio.
The outgoing dnewslink feeds cache open descriptors to avoid 'skipping
around' queue files. It seems to work quite well.
:>On another topic - what kind of locality of reference does caching news
:>history entries or path to articles have?
:>
:>-Dan Foster
:>Internet: dsf@frontiernet.net
One generally gets pretty good locality of reference, but a lot of
people make the mistake of trying to implement large software caches
that duplicate the caching already done by the kernel. For example,
if you lookup a history file entry with lseek()/read(), the difference
between caching the result and doing another lookup of the *same*
message-id with lseek()/read() will be minimal. Still, a small
message-id cache will reduce internal filesystem serialization locks
in the kernel enough to make it worth it. I don't bother in Diablo
because I usually need a 'guarenteed correct' result from history
file lookups to deal with multi-feed collisions.
-Matt
Technical Details
Message-ID:
<5pnje0$21e$1@flea.best.net>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:
<5pn3ck$137s$1@node17.cwnet.frontiernet.net>Show Full Headers
Complete Article Headers
Message-ID: <5pnje0$21e$1@flea.best.net> Subject: Re: Most efficient directory structure for news? Date: Sun, 06 Jul 1997 00:00:00 +0000 From: dillon@flea.best.net (Matt Dillon) References: <5pn3ck$137s$1@node17.cwnet.frontiernet.net> 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: 254948980 Organization: Best Internet Communications, Inc. - 415 964 BEST Newsgroups: news.software.nntp