🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #21914

New Diablo storage scheme being considered

#21914
From: Matt Dillon
Date: Fri, 26 Sep 1997 00:00
86 lines
3874 bytes
    My friend Dave and I came up with an excellent file storage + expiration 
    model to turn diablo's time-based expire into a true expire.ctl based
    expire.  I am interested in comments, so I will describe it:
 

    Current Diablo Scheme:

	Create a new directory every 10 minutes.  The name of the directory
	is based on the timestamp, e.g. 'D.00de95ea'.  Each incoming connection
	creates a private file in the 'current' directory to hold all
	articles received over that connection.  If the connection will 
	reopen its private file in the new 'current' directory every 10
	minutes.

	Advantages:		One writer process per file.. no internal
				kernel lock contention, no external locking
				required.

				Few files.. only around 50 files per directory.
				Around 200 directories w/ an 8G spool... 100%
				namei cache hit ratio.  (these numbers assume
				around 80 feeds).

				Expire is very fast due to fewer, larger files.

	Disadvantages:		No ability to expire based on time-group.  
				Expiration is in time-order only by rm -rf'ing
				directories until the free space target is
				met.
			
    New Diablo Scheme being considered:

	Rather then write all incoming articles to the current file in the
	current directory, one instead writes each article to a 
	future-time-indexed directory based on when the article is supposed
	to expire (which is in turn based on the group, article size, etc...).

	Each incoming connection now manages multiple open descriptors, but
	each descriptor still represents a 'private' file under the complete
	control of that connection.  Files are named algorithmically such
	that successive connections from the same feed source use the same
	naming scheme.  Since files must be exclusive to each connection,
	the algorithm provides a sequence of potential file names to attempt
	to use.  By using this naming scheme rather then the random scheme
	used in the current Diablo system, files created by previous sessions
	may be reused in later sessions.

	Advantages:		One writer process per file.. no internal
				kernel lock contention, no external per-write
				locking required. 

				Since files are 'reused', approximately the 
				same number of files will exist in the spool
				as compared to the old scheme, so the namei
				cache hit ratio will be 100%.

				True time-group expire control rather then
				a straight aging expire.

				expire still runs as fast as before due
				to fewer, larger files.

	Disadvantages:		Expire control files usually result in five
				or six different expires relative to the
				article reception time.  This means that 
				each diablo process will have to juggle
				6 descriptors rather then 1.

				More files will be opened for write and 
				will be written to simultaniously... 6x,
				though the write rate will remain the same.
				Presumably caching will deal with this,
				but there is an added vulnerability if the
				system crashes with so many files opened
				for write.

    What do people think?  I think it will fly.  I need to come up with a
    new scheme as a prerequisit to the reader support... for it to work
    right, a group-time based expire is absolutely required.

					    -Matt



Technical Details
Message-ID: <60hp3e$peq$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-mail

Show Full Headers
Complete Article Headers
Message-ID: <60hp3e$peq$1@flea.best.net>
Subject: New Diablo storage scheme being considered
Date: Fri, 26 Sep 1997 00:00:00 +0000
From: dillon@best.net (Matt Dillon)
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: 275873417
X-Trace: 875325359 17471 dillon 206.184.139.132
Organization: Best Internet Communications, Inc - 650 964 BEST
Newsgroups: news.software.nntp