3 ms·
Trying to see if Rust and Tokio have the same problem. I don't know enough about cgroups to be sure. Tokio at this line [1] ends up delegating to `std::thread::
by 01HNNWZ0MV43FF 1y ago
Trying to see if Rust and Tokio have the same problem. I don't know enough about cgroups to be sure. Tokio at this line [1] ends up delegating to `std::thread::available_parallelism` [2] which says
> It may overcount the amount of parallelism available when limited by a process-wide affinity mask or cgroup quotas and sched_getaffinity() or cgroup fs can’t be queried, e.g. due to sandboxing.
[1] https://docs.rs/tokio/1.45.0/src/tokio/loom/std/mod.rs.html#104 https://docs.rs/tokio/1.45.0/src/tokio/loom/std/mod.rs.html#...
[2] https://doc.rust-lang.org/stable/std/thread/fn.available_parallelism.html https://doc.rust-lang.org/stable/std/thread/fn.available_par...
- nvarsj 1y agoProbably not? The fundamental issue comes down to background GC and CPU quotas in cgroups. If your number of worker threads is too high, GC will eat up all the quota.