• requests: at any given time the amount of resources specified here are made available to the container.
  • limits: this is the maximum amount of resources that a container is allowed to use. If the container tries to use more resources than the container is throttled.
  • Container throttling can be bad because all threads in the container are throttled which includes the liveness and readiness probes. The container might be terminated if the kubelet doesn’t receive a response to the liveness probe.
  • see where the below information fits.
    • limits.cpu and requests.cpu are explicitly set
    • limits.cpu is set and kubernetes sets requests.cpu to the same value as limits.cpu
    • TODO also check this requests.cpu is set and limits.cpu is set with a greater value than the requests.cpu
    • TODO read about what happens if both are not set
      • Is there a concept of defaults at the namespace level or cluster level.
  • Arguments around usage of limits and requests for CPU

    • Argument 1 - Use requests and not limits

      • This argument as documented here stop using cpu limits1 talks about how specifying only cpu requests is sufficient to run containers properly.
      • The point here is if an containers requests the amount of cpu that is required then how would a noisy neighbor degrade your container’s performance.
      • Considering all containers use requests properly and if no limits are specified then containers can utilize the excess cpu in cases where it needs it and the performance is not throttled.
    • Argument 2 - limits are necessary

  • Footnotes

Footnotes

  1. https://home.robusta.dev/blog/stop-using-cpu-limits