Add --rpc-threads argument

This commit is contained in:
Michael Vines
2021-01-12 17:13:47 -08:00
parent e1b59ded4b
commit 11daaadc93
6 changed files with 17 additions and 2 deletions

View File

@ -112,6 +112,7 @@ pub struct JsonRpcConfig {
pub enable_bigtable_ledger_upload: bool,
pub max_multiple_accounts: Option<usize>,
pub account_indexes: HashSet<AccountIndex>,
pub rpc_threads: usize,
}
#[derive(Clone)]

View File

@ -273,6 +273,7 @@ impl JsonRpcService {
) -> Self {
info!("rpc bound to {:?}", rpc_addr);
info!("rpc configuration: {:?}", config);
let rpc_threads = 1.max(config.rpc_threads);
let health = Arc::new(RpcHealth::new(
cluster_info.clone(),
@ -374,7 +375,7 @@ impl JsonRpcService {
io,
move |_req: &hyper::Request<hyper::Body>| request_processor.clone(),
)
.threads(num_cpus::get())
.threads(rpc_threads)
.cors(DomainsValidation::AllowOnly(vec![
AccessControlAllowOrigin::Any,
]))