1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-02-14 12:12:21 +00:00

Automatically disable celldb direct I/O if cache is small (#997)

Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
EmelyanenkoK 2024-05-15 16:06:25 +03:00 committed by GitHub
parent 3827409957
commit 7a74888d2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1372,6 +1372,9 @@ td::Status ValidatorEngine::load_global_config() {
if (celldb_cache_size_) {
validator_options_.write().set_celldb_cache_size(celldb_cache_size_.value());
}
if (!celldb_cache_size_ || celldb_cache_size_.value() < (30ULL << 30)) {
celldb_direct_io_ = false;
}
validator_options_.write().set_celldb_direct_io(celldb_direct_io_);
validator_options_.write().set_celldb_preload_all(celldb_preload_all_);
if (catchain_max_block_delay_) {
@ -3985,9 +3988,9 @@ int main(int argc, char *argv[]) {
acts.push_back([&x, v]() { td::actor::send_closure(x, &ValidatorEngine::set_celldb_cache_size, v); });
return td::Status::OK();
});
p.add_option('\0', "celldb-no-direct-io", "disable direct I/O mode for RocksDb in CellDb", [&]() {
acts.push_back([&x]() { td::actor::send_closure(x, &ValidatorEngine::set_celldb_direct_io, false); });
});
p.add_option(
'\0', "celldb-no-direct-io", "disable direct I/O mode for RocksDb in CellDb (forced when celldb cache is < 30G)",
[&]() { acts.push_back([&x]() { td::actor::send_closure(x, &ValidatorEngine::set_celldb_direct_io, false); }); });
p.add_option(
'\0', "celldb-no-preload-all",
"disable preloading all cells from CellDb on startup (enabled by default)",