3 venti \- archival storage server
40 Venti is a SHA1-addressed archival storage server.
43 for a full introduction to the system.
44 This page documents the structure and operation of the server.
46 A venti server requires multiple disks or disk partitions,
47 each of which must be properly formatted before the server
50 The venti server maintains three disk structures, typically
51 stored on raw disk partitions:
54 which holds, in sequential order,
55 the contents of every block written to the server;
58 which helps locate a block in the data log given its score;
61 a concise summary of which scores are present in the index.
62 The data log is the primary storage.
63 To improve the robustness, it should be stored on
64 a device that provides RAID functionality.
65 The index and the bloom filter are optimizations
66 employed to access the data log efficiently and can be rebuilt
69 The data log is logically split into sections called
71 typically sized for easy offline backup
73 A data log may comprise many disks, each storing
76 .IR "arena partitions" .
77 Arena partitions are filled in the order given in the configuration.
79 The index is logically split into block-sized pieces called
81 each of which is responsible for a particular range of scores.
82 An index may be split across many disks, each storing many buckets.
84 .IR "index sections" .
86 The index must be sized so that no bucket is full.
87 When a bucket fills, the server must be shut down and
88 the index made larger.
89 Since scores appear random, each bucket will contain
90 approximately the same number of entries.
91 Index entries are 40 bytes long. Assuming that a typical block
92 being written to the server is 8192 bytes and compresses to 4096
93 bytes, the active index is expected to be about 1% of
95 Storing smaller blocks increases the relative index footprint;
96 storing larger blocks decreases it.
97 To allow variation in both block size and the random distribution
98 of scores to buckets, the suggested index size is 5% of
101 The (optional) bloom filter is a large bitmap that is stored on disk but
102 also kept completely in memory while the venti server runs.
103 It helps the venti server efficiently detect scores that are
105 already stored in the index.
106 The bloom filter starts out zeroed.
107 Each score recorded in the bloom filter is hashed to choose
109 bits to set in the bloom filter.
110 A score is definitely not stored in the index of any of its
113 The bloom filter thus has two parameters:
116 and the total bitmap size
117 (maximum 512MB, 2\s-2\u32\d\s+2 bits).
119 The bloom filter should be sized so that
128 is the expected number of blocks stored on the server
131 is the bitmap size in bits.
132 The false positive rate of the bloom filter when sized
133 this way is approximately 2\s-2\u\-\fInblock\fR\d\s+2.
135 less than 10 are not very useful;
137 greater than 24 are probably a waste of memory.
147 it will derive an appropriate
150 Venti can make effective use of large amounts of memory
155 holds recently-accessed venti data blocks, which the server refers to as
157 The lump cache should be at least 1MB but can profitably be much larger.
158 The lump cache can be thought of as the level-1 cache:
159 read requests handled by the lump cache can
164 holds recently-accessed
166 blocks from the arena partitions.
167 The block cache needs to be able to simultaneously hold two blocks
168 from each arena plus four blocks for the currently-filling arena.
169 The block cache can be thought of as the level-2 cache:
170 read requests handled by the block cache are slower than those
171 handled by the lump cache, since the lump data must be extracted
172 from the raw disk blocks and possibly decompressed, but no
173 disk accesses are necessary.
177 holds recently-accessed or prefetched
179 The index cache needs to be able to hold index entries
180 for three or four arenas, at least, in order for prefetching
181 to work properly. Each index entry is 50 bytes.
182 Assuming 500MB arenas of
183 128,000 blocks that are 4096 bytes each after compression,
184 the minimum index cache size is about 6MB.
185 The index cache can be thought of as the level-3 cache:
186 read requests handled by the index cache must still go
187 to disk to fetch the arena blocks, but the costly random
188 access to the index is avoided.
190 The size of the index cache determines how long venti
191 can sustain its `burst' write throughput, during which time
192 the only disk accesses on the critical path
193 are sequential writes to the arena partitions.
194 For example, if you want to be able to sustain 10MB/s
195 for an hour, you need enough index cache to hold entries
196 for 36GB of blocks. Assuming 8192-byte blocks,
197 you need room for almost five million index entries.
198 Since index entries are 50 bytes each, you need 250MB
200 If the background index update process can make a single
201 pass through the index in an hour, which is possible,
202 then you can sustain the 10MB/s indefinitely (at least until
203 the arenas are all filled).
207 requires memory equal to its size on disk,
210 A reasonable starting allocation is to
211 divide memory equally (in thirds) between
212 the bloom filter, the index cache, and the lump and block caches;
213 the third of memory allocated to the lump and block caches
214 should be split unevenly, with more (say, two thirds)
215 going to the block cache.
217 The venti server announces two network services, one
218 (conventionally TCP port
221 the venti protocol as described in
224 (conventionally TCP port
228 The venti web server provides the following
229 URLs for accessing status information:
232 A summary of the usage of the arenas and index sections.
239 Brief storage totals.
242 The current integer value of
246 whether or not to compress blocks
249 whether to write entries to the debugging logs;
251 whether to collect run-time statistics;
252 .BR icachesleeptime ,
253 the time in milliseconds between successive updates
254 of megabytes of the index cache;
255 .BR arenasumsleeptime ,
256 the time in milliseconds between reads while
257 checksumming an arena in the background.
258 The two sleep times should be (but are not) managed by venti;
259 they exist to provide more experience with their effects.
260 The other variables exist only for debugging and
261 performance measurement.
263 .BI /set/ variable / value
269 .BI /graph/ name / param / param / \fR...
270 A PNG image graphing the named run-time statistic over time.
271 The details of names and parameters are undocumented;
274 in the venti sources.
277 A list of all debugging logs present in the server's memory.
280 The contents of the debugging log with the given
284 Force venti to begin flushing the index cache to disk.
285 The request response will not be sent until the flush
289 Force venti to begin flushing the arena block cache to disk.
290 The request response will not be sent until the flush
294 Requests for other files are served by consulting a
295 directory named in the configuration file
299 .SS Configuration File
300 A venti configuration file
301 enumerates the various index sections and
302 arenas that constitute a venti system.
303 The components are indicated by the name of the file, typically
304 a disk partition, in which they reside. The configuration
305 file is the only location that file names are used. Internally,
306 venti uses the names assigned when the components were formatted
313 In particular, only the configuration needs to be
314 changed if a component is moved to a different file.
316 The configuration file consists of lines in the form described below.
322 Names the index for the system.
326 is an arena partition, formatted using
331 is an index section, formatted using
336 is a bloom filter, formatted using
340 After formatting a venti system using
342 the order of arenas and index sections should not be changed.
343 Additional arenas can be appended to the configuration;
348 flag to update the index.
350 The configuration file also holds configuration parameters
351 for the venti server itself.
365 network address to announce venti service
369 .BI httpaddr " netaddr
370 network address to announce HTTP service
375 queue writes in memory
376 (default is not to queue)
379 directory tree containing files for HTTP server
380 to consult for unrecognized URLs
383 The units for the various cache sizes above can be specified by appending a
389 to indicate kilobytes, megabytes, or gigabytes respectively.
393 name in the configuration lines above can be of the form
395 to specify a range of the file.
399 are specified in bytes but can have the usual
410 This notation eliminates the need to
411 partition raw disks on non-Plan 9 systems.
413 Many of the options to Venti duplicate parameters that
414 can be specified in the configuration file.
415 The command line options override those found in a
417 Additional options are:
420 The server configuration file
425 Produce various debugging information on standard error.
430 Enable logging. By default all logging is disabled.
431 Logging slows server operation considerably.
434 Do not run in the background.
436 the foreground process will exit once the Venti server
437 is initialized and ready for connections.
440 A simple configuration:
445 isect /tmp/disks/isect0
446 isect /tmp/disks/isect1
447 arenas /tmp/disks/arenas
448 bloom /tmp/disks/bloom
455 Format the index sections, the arena partition, and
456 finally the main index:
459 % venti/fmtisect isect0. /tmp/disks/isect0 &
460 % venti/fmtisect isect1. /tmp/disks/isect1 &
461 % venti/fmtarenas arenas0. /tmp/disks/arenas &
462 % venti/fmtbloom /tmp/disks/bloom &
464 % venti/fmtindex venti.conf
468 Start the server and check the storage statistics:
472 % hget http://$sysname/storage
475 .B \*9/src/cmd/venti/srv
483 Sean Quinlan and Sean Dorward,
484 ``Venti: a new approach to archival storage'',
485 .I "Usenix Conference on File and Storage Technologies" ,
488 Setting up a venti server is too complicated.
490 Venti should not require the user to decide how to
491 partition its memory usage.
493 Users of shells other than
495 will not be able to use the program names shown.
496 One solution is to define
497 .B "V=$PLAN9/bin/venti"