From c428835f855aa7417f3d48321bf208eb1657b360 Mon Sep 17 00:00:00 2001 From: Guilherme Lawless Date: Thu, 2 Jul 2020 10:58:10 +0100 Subject: [PATCH] Set default bootstrap initiator threads to 1 (#2832) For less powerful nodes especially with 2GB or less memory, having two bootstraps can do more harm than good. Moving to 2 threads is still a good approach for more robust nodes, which will be noted in https://docs.nano.org/running-a-node/ledger-management/#tuning-options --- nano/node/nodeconfig.cpp | 2 +- nano/node/nodeconfig.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nano/node/nodeconfig.cpp b/nano/node/nodeconfig.cpp index 9f3be797..4e45a7c6 100644 --- a/nano/node/nodeconfig.cpp +++ b/nano/node/nodeconfig.cpp @@ -78,7 +78,7 @@ nano::error nano::node_config::serialize_toml (nano::tomlconfig & toml) const toml.put ("enable_voting", enable_voting, "Enable or disable voting. Enabling this option requires additional system resources, namely increased CPU, bandwidth and disk usage.\ntype:bool"); toml.put ("bootstrap_connections", bootstrap_connections, "Number of outbound bootstrap connections. Must be a power of 2. Defaults to 4.\nWarning: a larger amount of connections may use substantially more system memory.\ntype:uint64"); toml.put ("bootstrap_connections_max", bootstrap_connections_max, "Maximum number of inbound bootstrap connections. Defaults to 64.\nWarning: a larger amount of connections may use additional system memory.\ntype:uint64"); - toml.put ("bootstrap_initiator_threads", bootstrap_initiator_threads, "Number of threads dedicated to concurrent bootstrap attempts. Defaults to 2 (if the number of CPU threads is more than 1), otherwise 1.\nWarning: a larger amount of attempts may use additional system memory and disk IO.\ntype:uint64"); + toml.put ("bootstrap_initiator_threads", bootstrap_initiator_threads, "Number of threads dedicated to concurrent bootstrap attempts. Defaults to 1.\nWarning: a larger amount of attempts may use additional system memory and disk IO.\ntype:uint64"); toml.put ("lmdb_max_dbs", deprecated_lmdb_max_dbs, "DEPRECATED: use node.lmdb.max_databases instead.\nMaximum open lmdb databases. Increase default if more than 100 wallets is required.\nNote: external management is recommended when a large number of wallets is required (see https://docs.nano.org/integration-guides/key-management/).\ntype:uint64"); toml.put ("block_processor_batch_max_time", block_processor_batch_max_time.count (), "The maximum time the block processor can continuously process blocks for.\ntype:milliseconds"); toml.put ("allow_local_peers", allow_local_peers, "Enable or disable local host peering.\ntype:bool"); diff --git a/nano/node/nodeconfig.hpp b/nano/node/nodeconfig.hpp index bd72ab81..5d5e135f 100644 --- a/nano/node/nodeconfig.hpp +++ b/nano/node/nodeconfig.hpp @@ -65,7 +65,7 @@ public: bool enable_voting{ false }; unsigned bootstrap_connections{ 4 }; unsigned bootstrap_connections_max{ 64 }; - unsigned bootstrap_initiator_threads{ network_params.network.is_test_network () ? 1u : std::min (2, std::max (1, std::thread::hardware_concurrency ())) }; + unsigned bootstrap_initiator_threads{ 1 }; nano::websocket::config websocket_config; nano::diagnostics_config diagnostics_config; size_t confirmation_history_size{ 2048 };