configure the tokio runtime tunables
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
65a370836c
commit
139a1ac504
1 changed files with 6 additions and 0 deletions
|
@ -20,6 +20,9 @@ use tokio::runtime;
|
||||||
const WORKER_NAME: &str = "conduwuit:worker";
|
const WORKER_NAME: &str = "conduwuit:worker";
|
||||||
const WORKER_MIN: usize = 2;
|
const WORKER_MIN: usize = 2;
|
||||||
const WORKER_KEEPALIVE: u64 = 36;
|
const WORKER_KEEPALIVE: u64 = 36;
|
||||||
|
const GLOBAL_QUEUE_INTERVAL: u32 = 192;
|
||||||
|
const SYSTEM_QUEUE_INTERVAL: u32 = 256;
|
||||||
|
const SYSTEM_EVENTS_PER_TICK: usize = 512;
|
||||||
|
|
||||||
rustc_flags_capture! {}
|
rustc_flags_capture! {}
|
||||||
|
|
||||||
|
@ -31,6 +34,9 @@ fn main() -> Result<(), Error> {
|
||||||
.thread_name(WORKER_NAME)
|
.thread_name(WORKER_NAME)
|
||||||
.worker_threads(args.worker_threads.max(WORKER_MIN))
|
.worker_threads(args.worker_threads.max(WORKER_MIN))
|
||||||
.thread_keep_alive(Duration::from_secs(WORKER_KEEPALIVE))
|
.thread_keep_alive(Duration::from_secs(WORKER_KEEPALIVE))
|
||||||
|
.global_queue_interval(GLOBAL_QUEUE_INTERVAL)
|
||||||
|
.event_interval(SYSTEM_QUEUE_INTERVAL)
|
||||||
|
.max_io_events_per_tick(SYSTEM_EVENTS_PER_TICK)
|
||||||
.build()
|
.build()
|
||||||
.expect("built runtime");
|
.expect("built runtime");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue