Add validator option to change niceness of RPC server threads

Fixes https://github.com/solana-labs/solana/issues/14556
This commit is contained in:
Ivan Mironov
2021-10-27 08:13:19 +05:00
committed by Trent Nelson
parent c78f474373
commit 0e751ef7df
3 changed files with 17 additions and 0 deletions

View File

@ -1173,6 +1173,16 @@ pub fn main() {
.default_value(&default_rpc_threads)
.help("Number of threads to use for servicing RPC requests"),
)
.arg(
Arg::with_name("rpc_niceness_adj")
.long("rpc-niceness-adjustment")
.value_name("ADJUSTMENT")
.takes_value(true)
.validator(is_niceness_adjustment_valid)
.default_value("0")
.help("Add this value to niceness of RPC threads. Negative value \
increases priority, positive value decreases priority.")
)
.arg(
Arg::with_name("rpc_bigtable_timeout")
.long("rpc-bigtable-timeout")
@ -2180,6 +2190,7 @@ pub fn main() {
u64
),
rpc_threads: value_t_or_exit!(matches, "rpc_threads", usize),
rpc_niceness_adj: value_t_or_exit!(matches, "rpc_niceness_adj", i8),
rpc_bigtable_timeout: value_t!(matches, "rpc_bigtable_timeout", u64)
.ok()
.map(Duration::from_secs),