3 ms·
You can easily limit the number of blocking threads tokio can spawn: https://docs.rs/tokio/latest/tokio/runtime/struct.Builder.html#method.max_blocking_threads
by veber-alex 3mo ago
You can easily limit the number of blocking threads tokio can spawn: https://docs.rs/tokio/latest/tokio/runtime/struct.Builder.html#method.max_blocking_threads https://docs.rs/tokio/latest/tokio/runtime/struct.Builder.ht...
- tcfhgj 3mo agoMight not be a good option though if you also spawn a bunch of blocking io tasks, which benefit from a large number of threads.
- diarrhea 3mo agoExactly. I do not know the specifics, but for example if libraries you call into liberally spawn_blocking under the expectation that it is okay, you will be in trouble. Says it right there actually: > It’s recommended to not set this limit too low in order to avoid hanging on operations requiring spawn_blocking. So a total like 6 - reasonable for a web backend - would be way too low.