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

Lesson 210 - GOMAXPROCS and K8s CFS scheduler #289

Closed
agravelot opened this issue Sep 25, 2024 · 2 comments
Closed

Lesson 210 - GOMAXPROCS and K8s CFS scheduler #289

agravelot opened this issue Sep 25, 2024 · 2 comments

Comments

@agravelot
Copy link

agravelot commented Sep 25, 2024

If your k8s node has more cpus than your deployment limit, the golang scheduler will not be aware of the kubernetes CFS scheduler, leading to many/all coroutines in a sleep state, false result.
Setting GOMAXPROCS=2 as in k8s deployment can lead to better performance.

https://github.com/uber-go/automaxprocs is specially designed for this purpose.

Related discussion: #288

@agravelot
Copy link
Author

agravelot commented Sep 25, 2024

I hadn't noticed this PR with better explaination: #278
May still be relevant to the current branch.

@antonputra
Copy link
Owner

Thank you, @agravelot! I did some more research and even ran tests. You're right—GOMAXPROCS makes a significant difference! I'll be using it in all my future benchmarks.

env:
- name: GOMAXPROCS
  valueFrom:
    resourceFieldRef:
      resource: limits.cpu
resources:
  requests:
    memory: 128Mi
    cpu: 500m
  limits:
    memory: 256Mi
    cpu: 1000m

https://www.youtube.com/watch?v=h2pCxj_Fkdc&t=984s

Screenshot 2024-10-03 at 12 41 02 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants