The scores of the blocks stored in the venti server are kept in memory only partially. When a request for a block comes in, all partial matches are determined, each specifying a block address in the data file. The block for each match is read from the data file and returned if the score in the block header is equal to the requested score. The number of bits kept in memory is the minimum number of bits required for a high probability (0.999) of resulting in a single match if the score is present. The required number of bits is determined from the arguments passed at startup. Maxdatasize is the maximum file size of the data file. Or, the last addressable block in the data file. Meanblocksize is the (expected) mean blocksize. These values are used to determine the number of storable blocks from which the amount of bits for the score is deduced. Note that the index file stores a fixed number of score bytes, so a ventisrv can be restarted with other values.
To determine the memory requirements for a ventisrv configuration, specify the -q option. It quits after initialisation and enables verbose output, before reading the index file, and thus prints the memory necessary for the configuration. If the system (e.g. emu) has too little heap memory available, a warning is printed.
Data blocks are stored in a normal, append-only file, specified with -d. The blocks are prepended with a header that holds the size, score and type of the block, and the starting time of the connection that wrote the block. The index file is also a normal, append-only file, specified with -i, that only has headers: a part of the score, type and offset of the block header in the data file. At startup, the blocks for the last 128 headers in the index file are verified (the (partial) scores in the headers and actual scores are checked). With -I the byte offset in the index file to start verifying at can be set, it should be a multiple of 15, the index header size. Missing headers are added from the data file to the index file if necessary. Thus, starting ventisrv after truncating the index file will regerenate it from the data file. Then the index file is read into memory (using only the minimum required bits).
Note that ventisrv does not authenticate connections and cannot use raw disks for storage.
VENTISRV(8 ) | Rev: Wed Feb 22 04:14:06 GMT 2023 |