[MUD-Dev] Persistant storage.... My current idea.
J C Lawrence
claw at under.engr.sgi.com
Wed Apr 22 16:26:32 New Zealand Standard Time 1998
Date: Sat, 4 Apr 1998 21:27:19 -0600
Message-Id: <199804050327.VAA08891 at laurel.actlab.utexas.edu>
From: Cynbe ru Taren <cynbe at muq.org>
To: cg at ami-cg.GraySage.Edmonton.AB.CA
Subject: [MUD-Dev] Persistant storage.... My current idea.
cc: claw at under.engr.sgi.com
cg at ami-cg.GraySage.Edmonton.AB.CA (Chris Gray):
| If you keep an index table in memory all the time, then there will also
| be no more than one disk read to get any DB entry.
| [...] After a few header words, index file is an array of small
| structs, containing a 16 bit slot length, a 16 bit 'used' length, and
| a 32 bit file offset.
True, but if ram is cheap, why use disk-basing at all? :)
What's your average object size?
I presume your scheme works well with your design, but with many
systems, statistics show an average object size of 13-16 bytes.
E.g., Smalltalk-78 I believe quoted a value in this range; QwestMUCK
when I was running it was dominated by strings with a similar size;
I'm sure most Lisp system would show similar statistics.
Clearly, if the average object size on disk is 16 bytes, and the
index file is 8 bytes/entry as above and kept in memory, then the
disk db can be at most twice as large as the RAM image, which
isn't a very satisfying space gain for the all the coding effort
involved in implementing diskbasing.
The vm.t module I'm using in Muq currently has an in-ram overhead
of 1 bit per object on disk, which means that a system with the
typical average object size of 16 bytes can support a limiting
db 128x larger than process ram footprint in principle, and probably
a comfortable 10x factor in practice.
(I'm trying to set up Muq as a general-purpose server suitable for
a wide range of applications, so I have to make fairly conservative
design decisions on these sorts of issues. A more tightly targetted
server can of course make different trade-offs.)
J C Lawrence Internet: claw at null.net
(Contractor) Internet: coder at ibm.net
---------(*) Internet: claw at under.engr.sgi.com
...Honourary Member of Clan McFud -- Teamer's Avenging Monolith...
MUD-Dev: Advancing an unrealised future.
More information about the MUD-Dev