visit
Quick question: do you know how much memory your app consumes? How about CPU time? What about spikes in the traffic? How do you deal with that in the context of the resource consumption?
Are you managing the memory and CPU constraints per container manually? Or, maybe you’re not there, yet. Maybe this whole resource consumption and constraints thing is totally new to you. Read on.
TL;DR: in Kubernetes it’s important that you set the CPU and memory resource requirements of your containers and we’re now about to automate this process.
Ben Visser, 12/2016 in:Unfortunately, Kubernetes has not yet implemented dynamic resource management, which is why we have to set resource limits for our containers.I imagine that at some point Kubernetes will start implementing a less manual way to manage resources, but this is all we have for now.
Antoine Cotten, 05/2016 in:Kubernetes doesn’t have dynamic resource allocation, which means that requests and limits have to be determined and set by the user. When these numbers are not known precisely for a service, a good approach is to start it with overestimated resources requests and no limit, then let it run under normal production load for a certain time: hours, days, weeks according to the nature of the service.
Now, it turns out that Google—in the context of —has such a resource consumption predictor/adjuster called autopilot, which does in fact offer an automatic resource consumption management.
Enter the person who brought this topic up at KubeCon 2016: Tim Hockin, one of the early Kubernetes committers when it was still a Google-internal project:
As the wise Tim stated in his talk Everything You Ever Wanted To Know About Resource Scheduling (also, check out the and the ):
This sounds quite convincing; way more than half of the Borg users seem to be happy to not only have the resource consumption set explicitly but also to delegate this job to autopilot.Some 2/3 of the Borg users use autopilot.
Back to Kubernetes.
Already in mid-2015 we find that the Kubernetes community — informed by Google’s autopilot experience—raised an to capture the need for an automated resource consumption management. In early 2017 the according was completed and now the initial work on the resulting Vertical Pod Autoscaler () is on its way.
A of resorcerer, its features and inner workings (~27min).
Screen shot of Prometheus, showing container CPU usage over time. The tricky part here is to pick meaningful PromQL queries as well as the right parameter for the observation time period. For starters, think of three cases: