Commit 5a46e23
committed
Add -C option for CPU quota limit on build containers
Similar to the existing -M option for memory limits, this adds a -C option
to set a CPU quota on the systemd-nspawn build containers.
This is useful for rebuilderd setups where you want to limit CPU usage
to prevent resource contention with other services on the same machine.
Usage:
repro -C 500% package.pkg.tar.zst # Limit to 5 CPU cores
repro -C 1200% -M 24G package.pkg.tar.zst # 12 cores, 24GB RAM
The CPU quota is passed to systemd-nspawn via --property="CPUQuota=...",
which sets the cgroup cpu.max limit on the container.
Environment variable MAX_CPU can also be used (e.g., in systemd service files):
Environment=MAX_CPU=500%1 parent 6729ed3 commit 5a46e23
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
| |||
583 | 584 | | |
584 | 585 | | |
585 | 586 | | |
| 587 | + | |
586 | 588 | | |
587 | 589 | | |
588 | 590 | | |
| |||
594 | 596 | | |
595 | 597 | | |
596 | 598 | | |
597 | | - | |
| 599 | + | |
598 | 600 | | |
599 | 601 | | |
600 | 602 | | |
601 | 603 | | |
602 | 604 | | |
603 | 605 | | |
| 606 | + | |
604 | 607 | | |
605 | 608 | | |
606 | 609 | | |
| |||
0 commit comments