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

The variable GOMAXPROCS does not work properly in Container environment #6413

Closed
DavadDi opened this issue Dec 6, 2019 · 3 comments
Closed

Comments

@DavadDi
Copy link

DavadDi commented Dec 6, 2019

In Kubernetes env, the containers spec as follows:

  containers:
  - args:
    image: quay.io/prometheus/prometheus:v2.11.0
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: "4" 
        memory: 128Gi
      requests:
        cpu: "4"
        memory: 128Gi

In Runtime Information of Prometheus:

GOMAXPROCS:  96   // The host CPUs number, I'd like to see the values of `containers.requests` 4

In this case, the Go program scheduling or GC pause may cost too long.

The library automaxprocs has solved the problem that Go programs cannot set GOMAXPROCS correctly in the case of Containers. Should we introduce this library to make Prometheus work as expected in the Kubernetes environment, or is it not appropriate to import this library because of other considerations?

@brian-brazil
Copy link
Contributor

This sounds like a feature request for Go, rather than something that every single application in existence should have to add.

@DavadDi
Copy link
Author

DavadDi commented Dec 6, 2019

@brian-brazil Good catch. I have noticed the issue 33803 that will be fixed on go 1.14. Indeed, It's better to be fixed in Golang. Good news for Gopher.

@DavadDi DavadDi closed this as completed Dec 6, 2019
@fcantournet
Copy link

I think you can safely re-open this issue and include uber/automaxprocs
The issue is unlikely to be resolved at the runtime level any time soon.
It was moved to backlog (from 1.14) and it's actually not trivial to implement in runtime pkg itself since you have... well pretty much nothing.

NB: the env variable works, what doesn't is the default value the runtime chooses in the absence of this variable.

@prometheus prometheus locked as resolved and limited conversation to collaborators Dec 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants