mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-27 02:44:18 +00:00
Optimize storage parameters for spatialDB
Summary: We need to start compression at level 1, while OptimizeForLevelComapaction() only sets up rocksdb to start compressing at level 2. I also adjusted some other things. Test Plan: compiles Reviewers: yinwang Reviewed By: yinwang Differential Revision: https://reviews.facebook.net/D22203
This commit is contained in:
parent
045575ad0c
commit
01cbdd2aae
|
@ -552,8 +552,18 @@ class SpatialDBImpl : public SpatialDB {
|
|||
namespace {
|
||||
Options GetRocksDBOptionsFromOptions(const SpatialDBOptions& options) {
|
||||
Options rocksdb_options;
|
||||
rocksdb_options.OptimizeLevelStyleCompaction();
|
||||
rocksdb_options.IncreaseParallelism(options.num_threads);
|
||||
rocksdb_options.write_buffer_size = 256 * 1024 * 1024; // 256MB
|
||||
rocksdb_options.max_bytes_for_level_base = 1024 * 1024 * 1024; // 1 GB
|
||||
// only compress levels >= 1
|
||||
rocksdb_options.compression_per_level.resize(rocksdb_options.num_levels);
|
||||
for (int i = 0; i < rocksdb_options.num_levels; ++i) {
|
||||
if (i == 0) {
|
||||
rocksdb_options.compression_per_level[i] = kNoCompression;
|
||||
} else {
|
||||
rocksdb_options.compression_per_level[i] = kLZ4Compression;
|
||||
}
|
||||
}
|
||||
rocksdb_options.block_cache = NewLRUCache(options.cache_size);
|
||||
if (options.bulk_load) {
|
||||
rocksdb_options.PrepareForBulkLoad();
|
||||
|
|
Loading…
Reference in a new issue