3 venti \- archival storage server
41 is a SHA1-addressed archival storage server.
44 for a full introduction to the system.
45 This page documents the structure and operation of the server.
47 A venti server requires multiple disks or disk partitions,
48 each of which must be properly formatted before the server
51 The venti server maintains three disk structures, typically
52 stored on raw disk partitions:
55 which holds, in sequential order,
56 the contents of every block written to the server;
59 which helps locate a block in the data log given its score;
62 a concise summary of which scores are present in the index.
63 The data log is the primary storage.
64 To improve the robustness, it should be stored on
65 a device that provides RAID functionality.
66 The index and the bloom filter are optimizations
67 employed to access the data log efficiently and can be rebuilt
70 The data log is logically split into sections called
72 typically sized for easy offline backup
74 A data log may comprise many disks, each storing
77 .IR "arena partitions" .
78 Arena partitions are filled in the order given in the configuration.
80 The index is logically split into block-sized pieces called
82 each of which is responsible for a particular range of scores.
83 An index may be split across many disks, each storing many buckets.
85 .IR "index sections" .
87 The index must be sized so that no bucket is full.
88 When a bucket fills, the server must be shut down and
89 the index made larger.
90 Since scores appear random, each bucket will contain
91 approximately the same number of entries.
92 Index entries are 40 bytes long. Assuming that a typical block
93 being written to the server is 8192 bytes and compresses to 4096
94 bytes, the active index is expected to be about 1% of
96 Storing smaller blocks increases the relative index footprint;
97 storing larger blocks decreases it.
98 To allow variation in both block size and the random distribution
99 of scores to buckets, the suggested index size is 5% of
102 The (optional) bloom filter is a large bitmap that is stored on disk but
103 also kept completely in memory while the venti server runs.
104 It helps the venti server efficiently detect scores that are
106 already stored in the index.
107 The bloom filter starts out zeroed.
108 Each score recorded in the bloom filter is hashed to choose
110 bits to set in the bloom filter.
111 A score is definitely not stored in the index of any of its
114 The bloom filter thus has two parameters:
117 and the total bitmap size
118 (maximum 512MB, 2\s-2\u32\d\s+2 bits).
120 The bloom filter should be sized so that
129 is the expected number of blocks stored on the server
132 is the bitmap size in bits.
133 The false positive rate of the bloom filter when sized
134 this way is approximately 2\s-2\u\-\fInblock\fR\d\s+2.
136 less than 10 are not very useful;
138 greater than 24 are probably a waste of memory.
148 it will derive an appropriate
151 Venti can make effective use of large amounts of memory
156 holds recently-accessed venti data blocks, which the server refers to as
158 The lump cache should be at least 1MB but can profitably be much larger.
159 The lump cache can be thought of as the level-1 cache:
160 read requests handled by the lump cache can
165 holds recently-accessed
167 blocks from the arena partitions.
168 The block cache needs to be able to simultaneously hold two blocks
169 from each arena plus four blocks for the currently-filling arena.
170 The block cache can be thought of as the level-2 cache:
171 read requests handled by the block cache are slower than those
172 handled by the lump cache, since the lump data must be extracted
173 from the raw disk blocks and possibly decompressed, but no
174 disk accesses are necessary.
178 holds recently-accessed or prefetched
180 The index cache needs to be able to hold index entries
181 for three or four arenas, at least, in order for prefetching
182 to work properly. Each index entry is 50 bytes.
183 Assuming 500MB arenas of
184 128,000 blocks that are 4096 bytes each after compression,
185 the minimum index cache size is about 6MB.
186 The index cache can be thought of as the level-3 cache:
187 read requests handled by the index cache must still go
188 to disk to fetch the arena blocks, but the costly random
189 access to the index is avoided.
191 The size of the index cache determines how long venti
192 can sustain its `burst' write throughput, during which time
193 the only disk accesses on the critical path
194 are sequential writes to the arena partitions.
195 For example, if you want to be able to sustain 10MB/s
196 for an hour, you need enough index cache to hold entries
197 for 36GB of blocks. Assuming 8192-byte blocks,
198 you need room for almost five million index entries.
199 Since index entries are 50 bytes each, you need 250MB
201 If the background index update process can make a single
202 pass through the index in an hour, which is possible,
203 then you can sustain the 10MB/s indefinitely (at least until
204 the arenas are all filled).
208 requires memory equal to its size on disk,
211 A reasonable starting allocation is to
212 divide memory equally (in thirds) between
213 the bloom filter, the index cache, and the lump and block caches;
214 the third of memory allocated to the lump and block caches
215 should be split unevenly, with more (say, two thirds)
216 going to the block cache.
218 The venti server announces two network services, one
219 (conventionally TCP port
222 the venti protocol as described in
225 (conventionally TCP port
229 The venti web server provides the following
230 URLs for accessing status information:
235 A summary of the usage of the arenas and index sections.
242 Brief storage totals.
245 Disable the values of all variables.
248 whether or not to compress blocks
251 whether to write entries to the debugging logs;
253 whether to collect run-time statistics;
254 .BR icachesleeptime ,
255 the time in milliseconds between successive updates
256 of megabytes of the index cache;
257 .BR arenasumsleeptime ,
258 the time in milliseconds between reads while
259 checksumming an arena in the background.
260 The two sleep times should be (but are not) managed by venti;
261 they exist to provide more experience with their effects.
262 The other variables exist only for debugging and
263 performance measurement.
265 .BI /set?name= variable
266 Show the current setting of
269 .BI /set?name= variable &value= value
275 .BI /graph?arg= name [&arg2= name] &graph= type ¶m= value \fR...
276 A PNG image graphing the
278 run-time statistic over time.
279 The details of names and parameters are mostly undocumented;
284 in the venti code for a list of possible statistics. The
286 of graph defaults to raw, see the
288 function for a list of types. Possible
290 include the timeframe
301 A list of all debugging logs present in the server's memory.
304 The contents of the debugging log with the given
308 Force venti to begin flushing the index cache to disk.
309 The request response will not be sent until the flush
313 Force venti to begin flushing the arena block cache to disk.
314 The request response will not be sent until the flush
318 Requests for other files are served by consulting a
319 directory named in the configuration file
323 .SS Configuration File
324 A venti configuration file
325 enumerates the various index sections and
326 arenas that constitute a venti system.
327 The components are indicated by the name of the file, typically
328 a disk partition, in which they reside. The configuration
329 file is the only location that file names are used. Internally,
330 venti uses the names assigned when the components were formatted
337 In particular, only the configuration needs to be
338 changed if a component is moved to a different file.
340 The configuration file consists of lines in the form described below.
344 .TF "\fLindex\fI name "
348 Names the index for the system.
352 is an arena partition, formatted using
357 is an index section, formatted using
362 is a bloom filter, formatted using
366 After formatting a venti system using
368 the order of arenas and index sections should not be changed.
369 Additional arenas can be appended to the configuration;
374 flag to update the index.
376 The configuration file also holds configuration parameters
377 for the venti server itself.
379 .TF "\fLhttpaddr\fI netaddr "
391 network address to announce venti service
395 .BI httpaddr " netaddr
396 network address to announce HTTP service
397 (default is not to start the service)
400 queue writes in memory
401 (default is not to queue)
404 directory tree containing files for
406 internal HTTP server to consult for unrecognized URLs
409 The units for the various cache sizes above can be specified by appending a
415 to indicate kilobytes, megabytes, or gigabytes respectively.
419 name in the configuration lines above can be of the form
421 to specify a range of the file.
425 are specified in bytes but can have the usual
436 This notation eliminates the need to
437 partition raw disks on non-Plan 9 systems.
439 Many of the options to Venti duplicate parameters that
440 can be specified in the configuration file.
441 The command line options override those found in a
443 Additional options are:
444 .TF "\fL-c\fI config"
448 The server configuration file
453 Produce various debugging information on standard error.
458 Enable logging. By default all logging is disabled.
459 Logging slows server operation considerably.
462 Allow only read access to the venti data.
465 Do not run in the background.
467 the foreground process will exit once the Venti server
468 is initialized and ready for connections.
471 A simple configuration:
476 isect /tmp/disks/isect0
477 isect /tmp/disks/isect1
478 arenas /tmp/disks/arenas
479 bloom /tmp/disks/bloom
486 Format the index sections, the arena partition,
487 the bloom filter, and
488 finally the main index:
491 % venti/fmtisect isect0. /tmp/disks/isect0
492 % venti/fmtisect isect1. /tmp/disks/isect1
493 % venti/fmtarenas arenas0. /tmp/disks/arenas &
494 % venti/fmtbloom /tmp/disks/bloom &
496 % venti/fmtindex venti.conf
500 Start the server and check the storage statistics:
504 % hget http://$sysname/storage
507 .B \*9/src/cmd/venti/srv
515 Sean Quinlan and Sean Dorward,
516 ``Venti: a new approach to archival storage'',
517 .I "Usenix Conference on File and Storage Technologies" ,
520 Setting up a venti server is too complicated.
522 Venti should not require the user to decide how to
523 partition its memory usage.
525 Users of shells other than
527 will not be able to use the program names shown.
528 One solution is to define
529 .B "V=$PLAN9/bin/venti"