Skip to content

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

@DavadDi

Description

@DavadDi

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions