Requests and Limits
There are requests and limits defined on a project level for both CPU and memory. But there are also requests and limits defined per container.
The following focuses on CPU but it works the same way for memory.
CPU Request Quota
The CPU Request Quota is set by nine and defines how much guaranteed CPU the project gets allocated.
CPU Limit Quota
The CPU Limit Quota is set by nine and defines how much CPU the project can use of the entire free CPU resources on the OpenShift cluster.
The project therefore benefits if not many other projects are on the cluster or if they are not using all of their resources.
Container CPU Request
A container is guaranteed to have as much CPU as it requests.
The sum of all container CPU requests can’t be bigger than the CPU Request Quota on project level.
Container CPU Limit
A container is guaranteed to have as much CPU as it requests and it can burst up to the Container CPU Limit, if possible.
Side-notes on Container CPU Limit:
- The container is not allowed to use more CPU than its limit.
- By having a CPU Limit that is greater than the CPU Request, you accomplish two things:
- The Pod can have bursts of activity where it makes use of CPU resources that happen to be available.
- The amount of CPU resources a Pod can use during a burst is limited to some reasonable amount.
- CPU Request and CPU Limit are associated with containers but it is useful to think of a Pod as having a CPU Request and CPU Limit.
- The CPU Request for a Pod is the sum of the CPU requests for all the containers in the Pod.
- Likewise, the CPU Limit for a Pod is the sum of the CPU limits for all the containers in the Pod.
- If no values for Container CPU Limit and Container CPU Request are set, the default values from the Limit Range are applied.