mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +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:
parent
3827409957
commit
7a74888d2f
1 changed files with 6 additions and 3 deletions
|
@ -1372,6 +1372,9 @@ td::Status ValidatorEngine::load_global_config() {
|
||||||
if (celldb_cache_size_) {
|
if (celldb_cache_size_) {
|
||||||
validator_options_.write().set_celldb_cache_size(celldb_cache_size_.value());
|
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_direct_io(celldb_direct_io_);
|
||||||
validator_options_.write().set_celldb_preload_all(celldb_preload_all_);
|
validator_options_.write().set_celldb_preload_all(celldb_preload_all_);
|
||||||
if (catchain_max_block_delay_) {
|
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); });
|
acts.push_back([&x, v]() { td::actor::send_closure(x, &ValidatorEngine::set_celldb_cache_size, v); });
|
||||||
return td::Status::OK();
|
return td::Status::OK();
|
||||||
});
|
});
|
||||||
p.add_option('\0', "celldb-no-direct-io", "disable direct I/O mode for RocksDb in CellDb", [&]() {
|
p.add_option(
|
||||||
acts.push_back([&x]() { td::actor::send_closure(x, &ValidatorEngine::set_celldb_direct_io, false); });
|
'\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(
|
p.add_option(
|
||||||
'\0', "celldb-no-preload-all",
|
'\0', "celldb-no-preload-all",
|
||||||
"disable preloading all cells from CellDb on startup (enabled by default)",
|
"disable preloading all cells from CellDb on startup (enabled by default)",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue