Overcommit Ratio

TIP

The cluster needs to have overcommit ratio enabled in order to set the namespace overcommit ratio.

What is the overcommit ratio?

You can set the overcommit ratio separately for the namespace based on the resource requirements for CPU and memory in the current namespace. This ensures that the limit and request values for containers set by users in this namespace are within a reasonable range, thereby improving the utilization of computing resources.

  • Limits: The maximum amount of resources that a container can use during runtime. The resource usage during container runtime cannot exceed this value.
  • Requests: The amount of resources that a container requests when it is created. When Kubernetes schedules containers, it judges based on this value and schedules the container to run on a node where the available resources meet the container’s request value. If there is no node that meets the requirement (for example, when the request value is greater than the available resources on the schedulable nodes), the container cannot start normally.
  • Overcommit Ratio: The ratio of limits to requests(limits/requests).

Example

Assuming the namespace overcommit ratio is set to 2, when creating an application and specifies a CPU limit of 4c, the corresponding CPU request value is calculated as:

CPU Request = CPU Limit / Overcommit Ratio

Thus, the CPU request becomes 4c / 2 = 2c.