Need card #17 · Relevance High · Status New

Tokio Application Performance Bottleneck: Lock Contention, System Work, and Missing Fine‑Grained Tracing

Updated 9/21/2026, 13:09:53

Problem

When building high‑concurrency services with Tokio, developers often face performance degradation due to lock contention, wasted CPU cycles from system work such as epoll and work stealing, and a lack of fine‑grained instrumentation that makes it difficult to locate these bottlenecks, hindering optimization of response times and resource utilization.

Pain points

Questions to verify

Evidence

quote
Be careful with mutexes" is good advice, but I'm surprised it doesn't explicitly call out the various channels that tokio provides as alternatives ... I'd estimate that at least half of the bottlenecks I've seen with mutexes when using tokio could have been avoided by not even using a mutex at all and instead passing the data that's truly needed across different tasks with some type of channel.
quote
All of the significant server applications I have encountered in the industry have suffered from the same problem, which surprised their authors but seemed obvious to me: the application was spending the majority of its CPU time doing meta-work like entering and leaving epoll, stealing work from itself, etc.
quote
When working on 20ms audio frames, Trusting MissedTickBehavior::Delay is not enough by itself. If you miss a tick, frames pile up. If you don't want that, you should drain all accumulated full frames on every single tick. Otherwise, a single missed tick can cause permanent latency.

Disclaimer: this card is distilled by AI from community discussions as “pain point evidence”. It is a starting point for need analysis and validation, not a “validated market need”. AI has analytical limits; please open the original discussion above to manually verify before key decisions.