Skip to content
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

Automatically set GOMAXPROCS #1560

Merged
merged 1 commit into from
May 27, 2019

Conversation

rubenvp8510
Copy link
Contributor

Which problem is this PR solving?

Short description of the changes

  • This PR set the GOMXPROCS to an automatic valid depending of the containers limits.

Does we need to make this configurable? I mean enable/disable using flags? @pavolloffay @objectiser

@objectiser
Copy link
Contributor

@yurishkuro This is probably one you should answer, especially as it is using the Uber automaxprocs package? Would you prefer it configurable or enabled all the time?

@pavolloffay
Copy link
Member

@rubenvp8510 did you test it on k8s? Does it use resource requests or limits?

@codecov
Copy link

codecov bot commented May 23, 2019

Codecov Report

Merging #1560 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1560   +/-   ##
=======================================
  Coverage   98.79%   98.79%           
=======================================
  Files         190      190           
  Lines        9063     9063           
=======================================
  Hits         8954     8954           
  Misses         85       85           
  Partials       24       24

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9923a46...597182f. Read the comment docs.

@yurishkuro
Copy link
Member

@objectiser it makes sense, when we build collector internally we're also using this module to adjust GOMAXPROCS

@jpkrohling jpkrohling changed the title [WIṔ] Automatically set GOMAXPROCS [WIP] Automatically set GOMAXPROCS May 24, 2019
@rubenvp8510
Copy link
Contributor Author

@pavolloffay Yes I did some tests and the library uses limits if they are defined.

With:

          resources:
            requests:
              memory: "64Mi"
              cpu: "250m"
            limits:
              memory: "128Mi"
              cpu: "2000m"

I got this:

2019/05/24 17:28:19 maxprocs: Updating GOMAXPROCS=2: determined from CPU quota

@yurishkuro should I leave this as it is? Or should I add a flag to enable/disable this behaviour?

Signed-off-by: Ruben Vargas <[email protected]>
@rubenvp8510 rubenvp8510 changed the title [WIP] Automatically set GOMAXPROCS Automatically set GOMAXPROCS May 24, 2019
Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

I think we should merge it. If someone needs this configurable in the future, they can create another issue.

@pavolloffay pavolloffay merged commit 4ed618d into jaegertracing:master May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants