Add --rpc-threads argument
This commit is contained in:
@ -38,7 +38,6 @@ log = "0.4.11"
|
||||
lru = "0.6.1"
|
||||
miow = "0.2.2"
|
||||
net2 = "0.2.37"
|
||||
num_cpus = "1.13.0"
|
||||
num-traits = "0.2"
|
||||
rand = "0.7.0"
|
||||
rand_chacha = "0.2.2"
|
||||
@ -88,6 +87,7 @@ trees = "0.2.1"
|
||||
|
||||
[dev-dependencies]
|
||||
matches = "0.1.6"
|
||||
num_cpus = "1.13.0"
|
||||
reqwest = { version = "0.10.8", default-features = false, features = ["blocking", "rustls-tls", "json"] }
|
||||
serial_test = "0.4.0"
|
||||
serial_test_derive = "0.4.0"
|
||||
|
@ -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)]
|
||||
|
@ -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,
|
||||
]))
|
||||
|
Reference in New Issue
Block a user