Skip to content

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

Closed
wants to merge 3 commits into from

Conversation

kylecarbs
Copy link
Member

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.

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.
Copy link
Member

@mafredri mafredri left a 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?

@kylecarbs
Copy link
Member Author

Great idea. Will do!

@github-actions github-actions bot added the stale This issue is like stale bread. label Nov 17, 2023
@github-actions github-actions bot closed this Nov 20, 2023
@mafredri
Copy link
Member

mafredri commented Nov 20, 2023

@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).

@mafredri mafredri reopened this Nov 20, 2023
Comment on lines +165 to +169
undoMacProcs, err := limitGoMaxProcs(logger)
if err != nil {
return xerrors.Errorf("set maxprocs: %w", err)
}
defer undoMacProcs()
Copy link
Member

@mafredri mafredri Nov 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 😄)

@mafredri mafredri removed the stale This issue is like stale bread. label Nov 20, 2023
@github-actions github-actions bot added the stale This issue is like stale bread. label Nov 28, 2023
@github-actions github-actions bot closed this Dec 1, 2023
@mafredri mafredri reopened this Dec 1, 2023
@github-actions github-actions bot removed the stale This issue is like stale bread. label Dec 2, 2023
@github-actions github-actions bot added the stale This issue is like stale bread. label Dec 9, 2023
@github-actions github-actions bot closed this Dec 12, 2023
@github-actions github-actions bot deleted the maxprocs branch May 10, 2024 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This issue is like stale bread.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants