From cede3452b4af6ada46c7cbef93e1ef7f1aa631ac Mon Sep 17 00:00:00 2001 From: abbycin Date: Sun, 16 Nov 2025 10:42:09 +0800 Subject: [PATCH] update --- rocksdb/main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rocksdb/main.cpp b/rocksdb/main.cpp index 996d141..c2f8254 100644 --- a/rocksdb/main.cpp +++ b/rocksdb/main.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -88,9 +89,9 @@ int main(int argc, char *argv[]) { table_options.block_cache = cache; cfo.table_factory.reset(NewBlockBasedTableFactory(table_options)); // the following three options makes it not trigger GC in test - cfo.level0_file_num_compaction_trigger = 1000; - cfo.write_buffer_size = 1 << 30; - cfo.max_write_buffer_number = 5; + cfo.level0_file_num_compaction_trigger = 10000; + cfo.write_buffer_size = 64 << 20; + cfo.max_write_buffer_number = 16; std::vector cfd{}; cfd.push_back(rocksdb::ColumnFamilyDescriptor("default", cfo)); @@ -99,6 +100,7 @@ int main(int argc, char *argv[]) { options.create_if_missing = true; options.allow_concurrent_memtable_write = true; options.enable_pipelined_write = true; + options.env->SetBackgroundThreads(4, rocksdb::Env::Priority::HIGH); auto ropt = rocksdb::ReadOptions(); auto wopt = rocksdb::WriteOptions();