`cargo build -j11` will limit parallelism to eleven cores. Cargo and rustc use the Make jobserver protocol [0][1][2] to coordinate their use of threads and processes, even when multiple rustc processes are running (as long as they are part of the same `cargo` or `make` invocation):
[0]: https://www.gnu.org/software/make/manual/html_node/Job-Slots...
[2]: https://github.com/rust-lang/cargo/issues/1744
[2]: https://github.com/rust-lang/rust/pull/42682
`nice cargo build` will run all threads at low priority, but this is generally a good idea if you want to prioritize interactive processes while running a build in the background.