During cargo run, rustc by default takes up all CPU resources. Is it possible to limit CPU usage? For example, cpulimit -l 40
works for cargo, but rustc
processes still use 100% of the CPU.
- Fedora release 40 (Forty): 6.9.7-200.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC
- rustc 1.79.0 (129f3b996 2024-06-10)
- cargo 1.79.0 (ffa9cf99a 2024-06-03)
- stable-x86_64-unknown-linux-gnu unchanged -rustc 1.79.0 (129f3b996 2024-06-10)
UPD: cargo build -j x
or CARGO_BUILD_JOBS=x
this helped.
cpulimit -m -l 40
?cargo build -j x
orCARGO_BUILD_JOBS=x
?systemd-run --scope --user --property CPUQuota=50% cargo run
maybe?rustc