Remix.run Logo
veber-alex a day ago

You can easily limit the number of blocking threads tokio can spawn: https://docs.rs/tokio/latest/tokio/runtime/struct.Builder.ht...

tcfhgj a day ago | parent [-]

Might 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 21 hours ago | parent [-]

Exactly. 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.