Kondense resize each container CPU every second with the following steps.
Kondense calculate the average CPU usage over the last INTERVAL
seconds. By default, INTERVAL
is 6 seconds.
We need the TARGET_AVG
to calculate the new CPU. By default, TARGET_AVG
is 0.8 so 80%.
new_cpu = average_cpu / TARGET_AVG
If new_cpu
is smaller than the current CPU limit, we just patch CPU limit with this new_cpu
.
If new_cpu
is higher than the current CPU limit, we exponentially increase new_cpu
with this formula:
new_cpu = new_cpu + (new_cpu * coeff)²
The bigger the coeff
, the stronger Kondense will increase the CPU.
We patch the CPU limit with this new_cpu
.