Compare commits

...

2 Commits

Author SHA1 Message Date
imilinovic
8f966f1e5e cache 1gb 2024-03-19 12:33:55 +01:00
imilinovic
5c4a8d8f50 increase cache size 2024-03-19 10:37:15 +01:00

View File

@ -25,7 +25,9 @@
#include <rocksdb/db.h>
#include <rocksdb/slice.h>
#include <rocksdb/cache.h>
#include <rocksdb/options.h>
#include <rocksdb/table.h>
#include <rocksdb/utilities/transaction.h>
#include <rocksdb/utilities/transaction_db.h>
@ -234,6 +236,11 @@ DiskStorage::DiskStorage(Config config)
kvstore_(std::make_unique<RocksDBStorage>()),
durable_metadata_(config) {
LoadPersistingMetadataInfo();
std::shared_ptr<rocksdb::Cache> cache = rocksdb::NewLRUCache(1024 * 1024 * 1024); // 1 GB
rocksdb::BlockBasedTableOptions table_options;
table_options.block_cache = cache;
kvstore_->options_.table_factory.reset(NewBlockBasedTableFactory(table_options));
kvstore_->options_.create_if_missing = true;
kvstore_->options_.comparator = new ComparatorWithU64TsImpl();
kvstore_->options_.compression = rocksdb::kNoCompression;