Choosing requests and limits for your containers

If you are uncertain of what values to use to set a request and/or limit for a container, the best means of determining those values is to watch them. With Heapster, or Prometheus, and Grafana, you can see how many resources are being consumed by each pod.

There is a three-step process that you can use with your code to see what it's taking:

  1. Run your code and review how many resources are consumed while idle
  2. Add load to your code and verify the resource consumption under load
  3. Having set constraints, run another load test for an sustained period of time to see that your code fits within the defined boundaries

The first step (reviewing while idle) will give you good numbers to start with. Leverage ...

Get Kubernetes for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.