🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
7 messages
7 total messages Started by Matt Dillon Fri, 26 Sep 1997 00:00
New Diablo storage scheme being considered
#21914
Author: 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



Re: New Diablo storage scheme being considered
#21936
Author: Matt Dillon
Date: Sun, 28 Sep 1997 00:00
33 lines
2352 bytes
    Well, I got alpha code running on news1.best.com.  It turned out to be
    pretty damn easy to do.  Basically the existing diablo spool format
    is used, but rather then have each forked diablo write to a private
    file in the last directory of the spool, it instead appends to private
    files throughout the spool based on the expiration of the article.

    The expiration is specified in dexpire.ctl as a percentage 1-100, where
    100 stores the article in the last directory and 1 stores the article
    in the first.  One directory is created every 10 minutes and the number
    of total directories rubberbands depending on the size of the spool.

    File names are chosen such that files written by earlier diablo processes
    can be appended to by later diablo processes.  They are still private...
    a non-blocking exclusive lock is obtained and if it fails another filename
    is chosen.

    The number of files in the spool wind up being about the same, and the
    expire mechanism is also the same... it still just rm -rf's directories
    from the beginning of the spool until the free space target is met.

    The preliminary code definitely eats more disk I/O then before, but that
    is based entirely on the number of different expires in the dexpire.ctl
    file and thus essentially configurable.  In fact, the scheme degenerates
    into the previous one-directory/one-file system if you set all the
    expires the same. 

    ( p.s. this stuff is a preliminary requirement to using diablo as a reader
    spool, which is why it's so important ).

						-Matt

Re: New Diablo storage scheme being considered
#21940
Author: Marc Slemko
Date: Sun, 28 Sep 1997 00:00
19 lines
1424 bytes
In <60luge$4i7$1@darla.visi.com> drechsau@yuck.net (Mike Horwath) writes:

>Number of file descriptors does increase since each 'diablo' process
>would have 3 batch files open, plus logging and history database
>updates.  But of course, the local groups aren't posted to all that
>often compared to the rest, so it wuld just be 2 batch files open and
>things can be opened on the fly, no need to preopen a batch file that
>will never be written to.

But then you need locking between diablo processes, which slows you
right down to only being able to write a small number of articles
at a time.  

That minimizes the benefit you get from the multiprocess model compared
to something like INN.  With the design of INN, the above works
well because it is one process.

Re: New Diablo storage scheme being considered
#21947
Author: Curt Welch
Date: Sun, 28 Sep 1997 00:00
117 lines
5380 bytes
dillon@best.net (Matt Dillon) wrote:
>     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'.

>     New Diablo Scheme being considered:

> 	... writes each article to a
> 	future-time-indexed directory based on when the article is supposed
> 	to expire ...

> 	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.

I think it's probably too easy for people to create a
aexpire.ctl that will maket this number much higher than 6.
And doing so could be a real unexpected performance problem
which could case some real problems.

>     What do people think?

I really, really, really, like space based expire (like Diablo does
now).  Will your new system work this way (i.e. removing enough
articles to get the free space back to a fixed amount)?  It doesn't
sound like it can.  Or if you try to make it work that way, say
by remvoing old article directories not on their "due" date, but
rather whenever they are needed to be removed based on disk space
(like the current expire), then you can run into a real problem
when you set the expire params wrong by mistake.

For example, lets say you set the dexpire.ctl to hold binaries for
1 day and everything else for 7 days.  And all is working fine.  You
have enough disk space so you actually end up with 3 days of binaries and
9 days of everything else.  But then things change when you're not
looking.  Some rogue binary groups have a run of high volume days, and
you have them listed in your "non-binary" 7 day list by mistake.

Your disk can now no longer hold 7 days of the "non-binaries".  The
expire process is forced to start expiring directories past the "current"
time.  If it gets so bad that it's more than a day ahead of time then
new incomming binaries are trying to be placed into future
directories that have already been expired.  What a mess.  It seems
to me that this would be very hard to get the expire paramaters
set "right" and keep them set "right".

And what happens when you try to change the expire params?  Nothing.
If you screew up and set your expire too far in advance, say
1 month (maybe by mistake), your spool fills up with all this stuff
that's in directories that aren't due to expire for a month.  Changing
the expire back down to 1 week and re-running expire won't help. The
damgage is already done.

Is this what you had in mind?  Or am I just worring about somthing
that isn't an issue because I missed some basic point?

What seems like a better way to do expire is to specify a small
number of article classes (based on newsgroup, size etc).  And then
specify how much of the news spool (by % volume) each of these classes
is allowed to use.  i.e. binaries get 50% of the spool, local groups
get 10%, everything else gets 40%.  Expire would then need to quickly
calculate the size in use by each class and remove articles/directories
based on these sizes and percentages to bring the spool back into balance.

You could place each of these classes into a different "current"
directory like you do now but the dir name would also include extra
chars to specify its class.

Expire would be space based just like it is now.  It would act as if
you had multiple spool partitions, one for each class of article.

I think this would have mostly the same performace as your system, but
not have the complex expire problems.  But it could require some
additional complexity to make it easy for expire to quickly calculate
total disk usage for each article class.  But I think at most this
would just be an expire cache file were it would record the total
disk usage of each directory.  New (or current) directories would
be sized (or re-sized) and added to the cache file for each expire
run.

Also, the epxire file should be different so the user is forced
to define the classes (as opposed to have them happen as a side
effect as it would be now).  Comments would warn the user of
performace problems due to too many classes.

Maybe something like:

class binary 50%
    newsgroup alt.bin*
    newsgroup alt.mag*
    sizegt    5k
end

class local 10%
    newsgroup best.*
end

class default 40%
    newsgroup *
end

Well, there are my initial thoughts....

-- 
Curt Welch
curt@kcwc.com
http://CurtWelch.Com/

Re: New Diablo storage scheme being considered
#21956
Author: Dale Ghent
Date: Mon, 29 Sep 1997 00:00
11 lines
879 bytes
Matt Dillon wrote:
 
>     ( p.s. this stuff is a preliminary requirement to using diablo as a reader
>     spool, which is why it's so important ).

...and there was much rejoicing.

			-Dale G.

Re: New Diablo storage scheme being considered
#21959
Author: Curt Welch
Date: Mon, 29 Sep 1997 00:00
22 lines
1323 bytes
dillon@best.net (Matt Dillon) wrote:
>     The expiration is specified in dexpire.ctl as a percentage 1-100, where
>     100 stores the article in the last directory and 1 stores the article
>     in the first.

>     In fact, the scheme degenerates
>     into the previous one-directory/one-file system if you set all the
>     expires the same.

Nice simple design.  I like that.  Good design.

But how are you going to build and expire the overview-like db?  That
looks tough with this format.  Have you worked out a simple solution
for that yet?

-- 
Curt Welch
curt@kcwc.com
http://CurtWelch.Com/

Re: New Diablo storage scheme being considered
#21963
Author: Matt Dillon
Date: Mon, 29 Sep 1997 00:00
39 lines
2128 bytes
:In article <19970929094309.058$ms@NewsReader.Com>,
:Curt Welch <curt@kcwc.com> wrote:
:>dillon@best.net (Matt Dillon) wrote:
:>>     The expiration is specified in dexpire.ctl as a percentage 1-100, where
:>>     100 stores the article in the last directory and 1 stores the article
:>>     in the first.
:>
:>>     In fact, the scheme degenerates
:>>     into the previous one-directory/one-file system if you set all the
:>>     expires the same.
:>
:>Nice simple design.  I like that.  Good design.
:>
:>But how are you going to build and expire the overview-like db?  That
:>looks tough with this format.  Have you worked out a simple solution
:>for that yet?
:>
:>-- 
:>Curt Welch
:>curt@kcwc.com
:>http://CurtWelch.Com/

    All newsreader elements are separate issues from newsfeed elements 
    and will be addressed by a separate subsystem.  I only contemplate adding
    a handful of features to the diablo binary itself: head (which it has 
    already), body, article, and some new feed features (message-id + path + 
    groups - article) to allow slaves to maintain an article number 
    translation database.

    Overview is going to be treated as a cache (either local or remote),
    allowing portions of it to get blown away at any time.  Article storage
    on the newsreader side will optionally be a real spool, a cache,
    or both.

					-Matt


Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads