-
Notifications
You must be signed in to change notification settings - Fork 881
chore: add automaxprocs to limit parallel processes inside containers #10594
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
I saw this post on HackerNews: https://www.riverphillips.dev/blog/go-cfs/. It seems like we could benefit from this as well, because Coder is so frequently deployed in a container.
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.
Nice! I had been meaning to add this, but I’m glad you did because I forgot. Should we do the agent as well?
Great idea. Will do! |
@kylecarbs I'm re-opening this since I'm good with having this merged. Seems there's a tiny lint issue remaining, but raising the cyclo limit seems fine for this PR (+1). |
undoMacProcs, err := limitGoMaxProcs(logger) | ||
if err != nil { | ||
return xerrors.Errorf("set maxprocs: %w", err) | ||
} | ||
defer undoMacProcs() |
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.
undoMacProcs, err := limitGoMaxProcs(logger) | |
if err != nil { | |
return xerrors.Errorf("set maxprocs: %w", err) | |
} | |
defer undoMacProcs() | |
undoMaxProcs, err := limitGoMaxProcs(logger) | |
if err != nil { | |
return xerrors.Errorf("set maxprocs: %w", err) | |
} | |
defer undoMaxProcs() |
(PS. Also other instances of mac procs 😄)
I saw this post on HackerNews: https://www.riverphillips.dev/blog/go-cfs/. It seems like we could benefit from this as well, because Coder is so frequently deployed in a container.