server: reduce alpha for our moving averages#188
Merged
Conversation
The 0.5 favors new values too strongly, making our Zabbix graphs too spiky.
The easiest example is on the success rate. Let's assume our current
EMA (Exponential Moving Average) is 100%, and then we get one failure. This is
how different alphas affect the EMA value.
EMA = 100%, Next Value = 0%
alpha = 0.1 -> 90%
alpha = 0.2 -> 80%
alpha = 0.3 -> 70%
alpha = 0.5 -> 50%
alpha = 0.8 -> 20%
That means that one failure immediately sends us under the warning
threshold (which is currently 60%). With alpha 0.2 it would take us 3 subsequent
failures and with 0.1 it would require 5 subsequent failures.
The situation is a bit more complicated with our startup times but assuming a
starting EMA is 60s and then we have one startup that takes 250s. The alphas
affect it this way:
Starting EMA: 60s, Next Value: 250s
alpha = 0.1 -> 79s
alpha = 0.2 -> 98s
alpha = 0.3 -> 117s
alpha = 0.5 -> 155s
alpha = 0.8 -> 212s
So with alpha 0.2 it would take 6 consecutive slow attempts to hit our warning
threshold (currently 200s) and with alpha 0.1 it would take 13 attempts.
I think both alpha 0.2 or 0.1 are fine for us but 0.5 too much.
But we may need different alphas for different stats. Because for the success
rate even lower than 0.1 would be fine, while for the startup times the alpha
can be much higher since we are only counting successful starts.
praiskup
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The 0.5 favors new values too strongly, making our Zabbix graphs too spiky.
The easiest example is on the success rate. Let's assume our current
EMA (Exponential Moving Average) is 100%, and then we get one failure. This is
how different alphas affect the EMA value.
That means that one failure immediately sends us under the warning
threshold (which is currently 60%). With alpha 0.2 it would take us 3 subsequent
failures and with 0.1 it would require 5 subsequent failures.
The situation is a bit more complicated with our startup times but assuming a
starting EMA is 60s and then we have one startup that takes 250s. The alphas
affect it this way:
Starting EMA: 60s, Next Value: 250s
So with alpha 0.2 it would take 6 consecutive slow attempts to hit our warning
threshold (currently 200s) and with alpha 0.1 it would take 13 attempts.
I think both alpha 0.2 or 0.1 are fine for us but 0.5 too much.
But we may need different alphas for different stats. Because for the success
rate even lower than 0.1 would be fine, while for the startup times the alpha
can be much higher since we are only counting successful starts.