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

Ignore starting pod cpu usage in horizontal autoscaler #29989

Closed
JorritSalverda opened this issue Aug 3, 2016 · 5 comments
Closed

Ignore starting pod cpu usage in horizontal autoscaler #29989

JorritSalverda opened this issue Aug 3, 2016 · 5 comments
Labels
area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node.

Comments

@JorritSalverda
Copy link

We're running java applications that use up to 2 vcpu's during start and after that never go above 2% of 1 vcpu. For this I've lowered the cpu request and limit around that 2%. This is fine as hard-capping doesn't seem to affect the large spike in cpu usage at the start, so it still starts up fast.

However when this happens the autoscaler kicks in and in no time I have 10 instead of 3 pods, all spiking in cpu usage and eating up all memory for no real good reason.

Is there a way - just like with the liveness probe - to delay a pod being evaluated for hpa?

@k8s-github-robot k8s-github-robot added area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. labels Aug 3, 2016
@dchen1107
Copy link
Member

cc/ @fgrzadkowski

@wojtek-t
Copy link
Member

wojtek-t commented Aug 4, 2016

@jszczepkowski
Copy link
Contributor

This should be one of cases of #29799: when pod is not READY or was created less then a minute ago, w do not autoscale and do not create error event.

@JorritSalverda
Copy link
Author

Isn't the cpu prior to the pod being ready taken into account in that first minute when it's ready? We see a steep scale up as soon as the first extra pod is added by the HPA. Our cpu usage before readiness is about 20x as high as during normal operation - our limit is more than 20x as high as request - , so if it's in any form taken into account you can see why it leads to scale up where it isn't really needed.

@JorritSalverda
Copy link
Author

This works reasonably well today. At time of creating this ticket I wasn't aware it is cpu request value that's used for hpa, I thought it was cpu limit. For our applications with cpu intensive startup we still see slightly more autoscaling than we would like, but not too big of an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node.
Projects
None yet
Development

No branches or pull requests

5 participants