JVM initial CPU spike in a Docker container JVM initial CPU spike in a Docker container docker docker

JVM initial CPU spike in a Docker container


Depends on your K8 version.

< 1.12:
In this version you have, as you are explaining, only the --horizontal-pod-autoscaler-upscale-delay flag for the Kube-Controller or the custom metrics in HPAv2. https://v1-11.docs.kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/

=>1.12:
Here we have gotten a new HPA algorithm, which discards unReady pods in its calculation leading to fewer auto correcting.

https://github.com/kubernetes/kubernetes/pull/68068

Change CPU sample sanitization in HPA. Ignore samples if:
- Pod is beeing initalized - 5 minutes from start defined by flag
- pod is unready
- pod is ready but full window of metric hasn't been colected since transition
- Pod is initialized - 5 minutes from start defined by flag:
- Pod has never been ready after initial readiness period.

This should help you here.