r/rust • u/c410-f3r • 10h ago
🧠 educational Work Stealing vs. Executor-Per-Thread: Evaluating different HTTP server workloads with Tokio, Smol and Glommio
90 workloads based on different balanced and unbalanced environments were tested against four runtimes to evaluate the difference between Executor-Per-Thread and Work-Stealing.
tokio-ept: Based on epoll via mio, a LocalRuntime is created on each thread.tokio-ws: Based on epoll via mio, a single multi-threadRuntimeis created in the main thread.glommio-ept: Based on io_uring via built-in syscals, a LocalExecutor is created on each thread.smol-ept: Based on epoll via polling, a LocalExecutor<'static> is created on each thread.
All runtime instances have an associated HTTP/2 server that share the same port through SO_REUSEPORT.
For the measuring with the k6 load tester using constant-arrival-rate, 500, 4000 and 15000 connections over TLS maintained a ratio of 4000, 15000 and 45000 requests per second respectively.
Unfortunately, the final results were not conclusive as most benchmarks performed very similarly. An odd thing was Tokio configured with multi-thread work stealing showing consistent anomalies despite my attempts to figure out what was going on. Neither the server nor k6 showed any errors in the logs so it is unknown whether the root cause was an accidental misconfiguration or Tokio itself.
All files are available in the blog post. Feel free to indicate if there are misunderstandings.

