This PR changes how Tortoise changes the resource requests.
Previously, we calculated the ideal size just by (VPA recommendation) * (1+buffer ratio). (buffer ratio is 0.1, by default)
But, then every time VPA's recommendation changes, vertical scaling could happen, which increases the frequency of vertical scaling depending on the service's nature, especially scaling up because scaling down is limited to happening only once an hour anyways.
This PR changes it to the following:
scale up
Scale up always happens when the ideal size goes higher than the current resource request.
But, then, we don't just apply the ideal size, but apply the ideal size * (1+buffer ratio).
Meaning, we increase the resource request more than actually needed,
which reduces the need of scaling up in the future.
scale down
We basically want to ignore too small scale down to reduce the frequency of restarts.
Every time we calculate the previous ideal value by current resource req / (1+buffer ratio).
And, if the current ideal value is much smaller than the previous ideal value, we apply scaling down.
What this PR does / why we need it:
This PR changes how Tortoise changes the resource requests.
Previously, we calculated the ideal size just by
(VPA recommendation) * (1+buffer ratio)
. (buffer ratio is 0.1, by default) But, then every time VPA's recommendation changes, vertical scaling could happen, which increases the frequency of vertical scaling depending on the service's nature, especially scaling up because scaling down is limited to happening only once an hour anyways.This PR changes it to the following:
scale up
Scale up always happens when the ideal size goes higher than the current resource request. But, then, we don't just apply the ideal size, but apply
the ideal size * (1+buffer ratio)
. Meaning, we increase the resource request more than actually needed, which reduces the need of scaling up in the future.scale down
We basically want to ignore too small scale down to reduce the frequency of restarts. Every time we calculate the previous ideal value by
current resource req / (1+buffer ratio)
. And, if the current ideal value is much smaller than the previous ideal value, we apply scaling down.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer: