rocksdb/util
Dhruba Borthakur 321dfdc3ae Allow having different compression algorithms on different levels.
Summary:
The leveldb API is enhanced to support different compression algorithms at
different levels.

This adds the option min_level_to_compress to db_bench that specifies
the minimum level for which compression should be done when
compression is enabled. This can be used to disable compression for levels
0 and 1 which are likely to suffer from stalls because of the CPU load
for memtable flushes and (L0,L1) compaction.  Level 0 is special as it
gets frequent memtable flushes. Level 1 is special as it frequently
gets all:all file compactions between it and level 0. But all other levels
could be the same. For any level N where N > 1, the rate of sequential
IO for that level should be the same. The last level is the
exception because it might not be full and because files from it are
not read to compact with the next larger level.

The same amount of time will be spent doing compaction at any
level N excluding N=0, 1 or the last level. By this standard all
of those levels should use the same compression. The difference is that
the loss (using more disk space) from a faster compression algorithm
is less significant for N=2 than for N=3. So we might be willing to
trade disk space for faster write rates with no compression
for L0 and L1, snappy for L2, zlib for L3. Using a faster compression
algorithm for the mid levels also allows us to reclaim some cpu
without trading off much loss in disk space overhead.

Also note that little is to be gained by compressing levels 0 and 1. For
a 4-level tree they account for 10% of the data. For a 5-level tree they
account for 1% of the data.

With compression enabled:
* memtable flush rate is ~18MB/second
* (L0,L1) compaction rate is ~30MB/second

With compression enabled but min_level_to_compress=2
* memtable flush rate is ~320MB/second
* (L0,L1) compaction rate is ~560MB/second

This practicaly takes the same code from https://reviews.facebook.net/D6225
but makes the leveldb api more general purpose with a few additional
lines of code.

Test Plan: make check

Differential Revision: https://reviews.facebook.net/D6261
2012-10-29 11:48:09 -07:00
..
arena_test.cc A number of fixes: 2011-10-31 17:22:06 +00:00
arena.cc A number of fixes: 2011-10-31 17:22:06 +00:00
arena.h A number of fixes: 2011-10-31 17:22:06 +00:00
auto_split_logger.h Add the missing util/auto_split_logger.h 2012-10-26 15:23:50 -07:00
bloom_test.cc Added bloom filter support. 2012-04-17 08:36:46 -07:00
bloom.cc bits_per_key is already configurable. It defines how many bloom bits will be used for every key in the database. 2012-07-09 23:06:07 -07:00
build_version.h Record the version of the source repository that was used to build the leveldb library. 2012-08-21 14:47:15 -07:00
cache_test.cc A number of fixes: 2011-10-31 17:22:06 +00:00
cache.cc Print the block cache size in the LOG. 2012-09-29 21:39:19 -07:00
coding_test.cc merge 1.5 2012-08-28 11:43:33 -07:00
coding.cc A number of fixes: 2011-10-31 17:22:06 +00:00
coding.h A number of fixes: 2011-10-31 17:22:06 +00:00
comparator.cc merge 1.5 2012-08-28 11:43:33 -07:00
crc32c_test.cc A number of fixes: 2011-10-31 17:22:06 +00:00
crc32c.cc SSE4 optimization 2012-05-15 10:10:01 -07:00
crc32c.h A number of fixes: 2011-10-31 17:22:06 +00:00
env_hdfs.cc Clean up compiler warnings generated by -Wall option. 2012-08-29 14:24:51 -07:00
env_posix.cc An configurable option to write data using write instead of mmap. 2012-10-03 17:08:13 -07:00
env_test.cc fixed issues 66 (leaking files on disk error) and 68 (no sync of CURRENT file) 2012-01-25 14:56:52 -08:00
env.cc fixed issues 66 (leaking files on disk error) and 68 (no sync of CURRENT file) 2012-01-25 14:56:52 -08:00
filelock_test.cc Prevent concurrent multiple opens of leveldb database. 2012-08-20 23:55:04 -07:00
filter_policy.cc Added bloom filter support. 2012-04-17 08:36:46 -07:00
hash.cc A number of fixes: 2011-10-31 17:22:06 +00:00
hash.h reverting disastrous MOE commit, returning to r21 2011-04-19 23:11:15 +00:00
histogram.cc A number of fixes: 2011-10-31 17:22:06 +00:00
histogram.h A number of fixes: 2011-10-31 17:22:06 +00:00
logging.cc A number of fixes: 2011-10-31 17:22:06 +00:00
logging.h A number of fixes: 2011-10-31 17:22:06 +00:00
murmurhash.cc Implement RowLocks for assoc schema 2012-10-03 23:19:01 -07:00
murmurhash.h Implement RowLocks for assoc schema 2012-10-03 23:19:01 -07:00
mutexlock.h Implement ReadWrite locks for leveldb 2012-10-01 22:37:39 -07:00
options.cc Allow having different compression algorithms on different levels. 2012-10-29 11:48:09 -07:00
posix_logger.h Enable LevelDb to create a new log file if current log file is too large. 2012-10-26 14:55:02 -07:00
random.h A number of fixes: 2011-10-31 17:22:06 +00:00
stats_logger.h Clean up compiler warnings generated by -Wall option. 2012-08-29 14:24:51 -07:00
status.cc A number of fixes: 2011-10-31 17:22:06 +00:00
testharness.cc A number of fixes: 2011-10-31 17:22:06 +00:00
testharness.h A number of fixes: 2011-10-31 17:22:06 +00:00
testutil.cc A number of fixes: 2011-10-31 17:22:06 +00:00
testutil.h A number of fixes: 2011-10-31 17:22:06 +00:00