mirror of https://github.com/fafhrd91/actix-net
reduce default max blocking thread count for each worker to 512 / core count
This commit is contained in:
parent
7f9394734a
commit
65964017c1
|
@ -168,10 +168,11 @@ pub(crate) struct ServerWorkerConfig {
|
||||||
|
|
||||||
impl Default for ServerWorkerConfig {
|
impl Default for ServerWorkerConfig {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
|
// 512 is the default max blocking thread count of tokio runtime.
|
||||||
|
let max_blocking_threads = std::cmp::max(512 / num_cpus::get(), 1);
|
||||||
Self {
|
Self {
|
||||||
shutdown_timeout: Duration::from_secs(30),
|
shutdown_timeout: Duration::from_secs(30),
|
||||||
// default max_blocking_threads is the same as tokio's default
|
max_blocking_threads,
|
||||||
max_blocking_threads: 512,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue