-
Notifications
You must be signed in to change notification settings - Fork 69
chore: Follow up to #731 #743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -114,7 +113,7 @@ func archiveCompose(ctx context.Context, zw *zip.Writer, verbose, noConfigs bool | |||
// setup channel for slice of archive function outputs | |||
ch := make(chan *archiveFile) | |||
g, ctx := errgroup.WithContext(ctx) | |||
semaphore := semaphore.NewWeighted(8) | |||
semaphore := semaphore.NewWeighted(int64(runtime.GOMAXPROCS(0))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is interesting, I'm not familiar with runtime.GOMAXPROCS(0)
, will definitely do some research here 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It gives you the recommended number of processes/goroutines that can run in parallel (not just concurrently). It's relational to your cpu die count.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, will this potentially reintroduce issues with open file limits? Or reduce the effectiveness of the semaphore in throttling remotely executed requests? In my understanding, this will scale the semaphore's limit to the host machine running src
's resources?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Number of cpu cores is way under the Linux file handle limit by many orders of magnitude
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good and mostly seems like clarification of naming conventions. Except semaphore := semaphore.NewWeighted(int64(runtime.GOMAXPROCS(0)))
which I'll need to learn more about.
Has the command been tested with these changes? If not I'm happy to test these out before merge.
Approving anyway
Following up from additional comments in #731 (some were hidden by the long timeline in the github view pre merge, and @DaedalusG and I forgot to address these in our 1-1).
Test plan
N/A.