We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c189b70 commit b367d82Copy full SHA for b367d82
pkg/chunk/aws/metrics_autoscaling.go
@@ -22,7 +22,7 @@ const (
22
queueLengthScaledown = 10000 // consider scaling down if queue smaller than this
23
queueLengthAcceptable = 100000 // we don't mind queues smaller than this
24
queueLengthMax = 1000000 // always scale up if queue bigger than this
25
- errorRateScaledown = 1
+ errorFractionScaledown = 0.1
26
scaledown = 0.9
27
scaleup = 1.2
28
)
@@ -45,7 +45,7 @@ func (d dynamoTableClient) metricsAutoScale(ctx context.Context, current, expect
45
level.Info(util.Logger).Log("msg", "checking metrics", "table", current.Name, "queueLengths", fmt.Sprint(m.queueLengths), "errorRate", errorRate)
46
47
switch {
48
- case m.queueLengths[2] < queueLengthScaledown && errorRate < errorRateScaledown:
+ case m.queueLengths[2] < queueLengthScaledown && errorRate < errorFractionScaledown*float64(current.ProvisionedWrite):
49
// No big queue, low errors -> scale down
50
expected.ProvisionedWrite = int64(float64(current.ProvisionedWrite) * scaledown)
51
level.Info(util.Logger).Log("msg", "metrics scale-down", "table", current.Name, "write", expected.ProvisionedWrite)
pkg/chunk/aws/metrics_autoscaling_test.go
@@ -92,7 +92,7 @@ func TestTableManagerMetricsAutoScaling(t *testing.T) {
92
staticTable(0, read, 233, read, 162)...), // - scale down both again
93
94
95
- mockProm.SetResponse(0, 0, 0, 1, 1, 1, 1)
+ mockProm.SetResponse(0, 0, 0, 30, 30, 30, 30)
96
test(t, client, tableManager, "Next week",
97
startTime.Add(tablePeriod),
98
// Nothing much happening - expect table 0 write rates to stay as-is and table 1 to be created with defaults
@@ -102,7 +102,7 @@ func TestTableManagerMetricsAutoScaling(t *testing.T) {
102
103
104
// No errors on last week's index table, still some on chunk table
105
- mockProm.SetResponse(0, 0, 0, 0, 1, 1, 1)
+ mockProm.SetResponse(0, 0, 0, 0, 30, 30, 30)
106
test(t, client, tableManager, "Next week plus a bit",
107
startTime.Add(tablePeriod).Add(time.Minute*10),
108
append(append(baseTable("a", inactiveRead, inactiveWrite),
0 commit comments