8 Commits

Author SHA1 Message Date
Patrick McGleenon
e392c4ff1e
chore: update CI to clippy 1.76 (#6334)
Co-authored-by: Rafael Bachmann <rafael.bachmann.93@gmail.com>
2024-02-10 10:45:40 +01:00
Alice Ryhl
52f28dcb4f
benches: fix benchmarking conflicts for real this time (#6246) 2023-12-28 09:52:18 +00:00
Alice Ryhl
7cae89af47
benches: fix benchmarking conflicts (#6243) 2023-12-22 22:43:05 +00:00
M.Amin Rayej
b046c0dcbb
benches: use criterion instead of bencher (#5981) 2023-09-10 16:42:53 +02:00
Carl Lerche
79a7e78c0d
rt(threaded): basic self-tuning of injection queue (#5720)
Each multi-threaded runtime worker prioritizes pulling tasks off of its
local queue. Every so often, it checks the injection (global) queue for
work submitted there. Previously, "every so often," was a constant
"number of tasks polled" value. Tokio sets a default of 61, but allows
users to configure this value.

If workers are under load with tasks that are slow to poll, the
injection queue can be starved. To prevent starvation in this case, this
commit implements some basic self-tuning. The multi-threaded scheduler
tracks the mean task poll time using an exponentially-weighted moving
average. It then uses this value to pick an interval at which to check
the injection queue.

This commit is a first pass at adding self-tuning to the scheduler.
There are other values in the scheduler that could benefit from
self-tuning (e.g. the maintenance interval). Additionally, the
current-thread scheduler could also benfit from self-tuning. However, we
have reached the point where we should start investigating ways to unify
logic in both schedulers. Adding self-tuning to the current-thread
scheduler will be punted until after this unification.
2023-06-01 08:13:24 -07:00
Carl Lerche
3a94eb0893
rt: batch pop from injection queue when idle (#5705)
In the multi-threaded scheduler, when there are no tasks on the local
queue, a worker will attempt to pull tasks from the injection queue.
Previously, the worker would only attempt to poll one task from the
injection queue then continue trying to find work from other sources.
This can result in the injection queue backing up when there are many
tasks being scheduled from outside of the runtime.

This patch updates the worker to try to poll more than one task from the
injection queue when it has no more local work. Note that we also don't
want a single worker to poll **all** tasks on the injection queue as
that would result in work becoming unbalanced.
2023-05-23 08:16:41 -07:00
Taiki Endo
08ed41f339
chore: fix typos (#3907) 2021-07-01 02:06:56 +09:00
Carl Lerche
97c2c4203c
chore: automate running benchmarks (#3140)
Uses Github actions to run benchmarks.
2020-11-13 19:30:52 -08:00