From 07da76d08c8e4c16d4434e5f881e67f6c9faf551 Mon Sep 17 00:00:00 2001 From: yukang Date: Tue, 21 May 2024 15:05:16 +0800 Subject: [PATCH] use full cpu cores for RPC service --- ckb-bin/src/subcommand/run.rs | 2 +- test/template/ckb.toml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ckb-bin/src/subcommand/run.rs b/ckb-bin/src/subcommand/run.rs index 0659724ae2..8d5ff1b22d 100644 --- a/ckb-bin/src/subcommand/run.rs +++ b/ckb-bin/src/subcommand/run.rs @@ -76,6 +76,6 @@ pub fn run(args: RunArgs, version: Version, async_handle: Handle) -> Result<(), fn calc_rpc_threads_num(args: &RunArgs) -> usize { let system_parallelism: usize = available_parallelism().unwrap().into(); - let default_num = usize::max(system_parallelism - 1, 1); + let default_num = usize::max(system_parallelism, 1); args.config.rpc.threads.unwrap_or(default_num) } diff --git a/test/template/ckb.toml b/test/template/ckb.toml index bfcacd8594..f713d47abc 100644 --- a/test/template/ckb.toml +++ b/test/template/ckb.toml @@ -76,8 +76,7 @@ reject_ill_transactions = true # By default deprecated rpc methods are disabled. enable_deprecated_rpc = true -# threads number for RPC service, -# default it's equal to the number of CPU cores minus one +# threads number for RPC service, default value is the number of CPU cores # threads = 4 [tx_pool]