Skip to content

Commit

Permalink
use full cpu cores for RPC service
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyukang committed May 21, 2024
1 parent e9093b8 commit 07da76d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ckb-bin/src/subcommand/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
3 changes: 1 addition & 2 deletions test/template/ckb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 07da76d

Please sign in to comment.