tokio-rs / website

Website for the Tokio project
https://tokio.rs
MIT License
226 stars 327 forks source link

Recommendations for performance tuning of code running on the tokio runtime #462

Open nicholasbishop opened 4 years ago

nicholasbishop commented 4 years ago

As background, I have a couple related services that use async code with the tokio runtime, and the overall throughput just isn't where I would expect it to be. I'm not sure how best to figure out where the performance problems are occurring.

For example, Is there a good way to detect code that is supposed to be async, but instead blocks for a significant amount of time? I've read about the proposal to add a "may_block" attribute to help warn of problems at compile time, but I am also interested in analyzing the runtime behavior of my code to see where it might be blocking.

Looking for async code that is accidentally blocking seems like the most obvious potential source of performance problems, but perhaps there are other things I should be looking for? What tools should I be using to benchmark and profile my async code?

Darksonn commented 3 years ago

See tokio#2702.