fix: bound CPU parallelism for snapshot job scheduler, zstd and git pack operations#161
Merged
fix: bound CPU parallelism for snapshot job scheduler, zstd and git pack operations#161
Conversation
zstd was using -T0 (all cores) and git pack.threads was set to 0 (all cores), causing sustained CPU throttling in both staging and production. Limit both to 4 threads to stay within pod CPU limits. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
With zstd capped at 4 threads, running NumCPU concurrent snapshot jobs simultaneously still saturates the CPU limit (8 cores × 4 threads = 32). Capping concurrency at 4 limits simultaneous CPU-intensive jobs to 4 × 4 = 16 zstd threads, staying within the pod's 8–10 core budget. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
nssherpa
commented
Feb 26, 2026
|
|
||
| type Config struct { | ||
| Concurrency int `hcl:"concurrency" help:"The maximum number of concurrent jobs to run (0 means number of cores)." default:"0"` | ||
| Concurrency int `hcl:"concurrency" help:"The maximum number of concurrent jobs to run (0 means number of cores)." default:"4"` |
Contributor
Author
There was a problem hiding this comment.
Perhaps this can go in the hcl if we don't want the default here.
Contributor
Author
There was a problem hiding this comment.
Contributor
Author
There was a problem hiding this comment.
In line 95 runtime.NumCPU() returns the total number of logical cores on the node vs the cores limited to the container, so I don't mind setting a non-zero default here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
zstd was using -T0 (all cores) and git pack.threads was set to 0 (all
cores), causing sustained CPU throttling in both staging and production.
Limit both to 4 threads to stay within pod CPU limits.