From 6d3dbcb129b67152c89bbbe2a7dad98b071bf838 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Dec 2026 13:19:32 +0000 Subject: Two options for a node on a machine that should idle --libp2p-ping-interval: how often libp2p pings each open connection, 15 s unless given, 0 for once as it opens. The pings keep no connection open and close none; continuum takes each connection's round trip from them, to keep the fastest of several to one peer. --worker-threads: how many threads take the node's work in turns, as many as the machine has cores unless given. The runtime is built from the configuration, so the count is set as the node starts. Each wakes the node's threads less often; docs/operations.md, An idle node, says what to choose, and what was measured. --- src/transport/libp2p/config.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/transport/libp2p/config.rs') diff --git a/src/transport/libp2p/config.rs b/src/transport/libp2p/config.rs index 712f2e2..70a8561 100644 --- a/src/transport/libp2p/config.rs +++ b/src/transport/libp2p/config.rs @@ -21,6 +21,9 @@ pub(crate) struct Libp2pConfig { pub(crate) mdns: bool, /// Ask the router to forward our listen ports (UPnP), and publish where. pub(crate) upnp: bool, + /// How often each open connection is pinged after the ping as it opens; zero for + /// never (`--libp2p-ping-interval`). + pub(crate) ping_interval: std::time::Duration, /// Address ranges neither published nor dialled, nor connected over (`Ignoring`). pub(crate) ignore: Vec, /// Address ranges that matter most, best first (`Book::preference`). @@ -136,6 +139,7 @@ impl Libp2pConfig { continuum: !relay_only, mdns: settings.libp2p_mdns, upnp: settings.libp2p_upnp, + ping_interval: settings.libp2p_ping_interval, ignore: parse_ranges("libp2p-ignore", &settings.libp2p_ignore)?, prefer: parse_ranges("libp2p-prefer", &settings.libp2p_prefer)?, internet_hosts: settings.libp2p_internet_hosts.clone(), -- cgit v1.3.1