test: set number of RPC server threads to 2

The default `-rpcthreads` value spawns 16 HTTP server threads for each node.
Running the functional test suite with default `rpcthreads` can exhaust file
descriptors or hit other resource limits very easily.
Moreover, having 16 threads is unnecessary since they are mostly idle. We
run RPC calls on a single RPC connection and wait for it result synchronously.
There is (almost) never two RPC calls occurring concurrently.
Because of this, the threads are mostly idle, so we can safely limit the number
of them to two.
This commit is contained in:
furszy
2025-10-22 08:07:34 -04:00
parent d30f149360
commit e9cd45e3d3

View File

@@ -444,6 +444,7 @@ def write_config(config_path, *, n, chain, extra_config="", disable_autoconnect=
# Disable server-side timeouts to avoid intermittent issues # Disable server-side timeouts to avoid intermittent issues
f.write("rpcservertimeout=99000\n") f.write("rpcservertimeout=99000\n")
f.write("rpcdoccheck=1\n") f.write("rpcdoccheck=1\n")
f.write("rpcthreads=2\n")
f.write("fallbackfee=0.0002\n") f.write("fallbackfee=0.0002\n")
f.write("server=1\n") f.write("server=1\n")
f.write("keypool=1\n") f.write("keypool=1\n")