Decrease scale_down ratio for faster deflation

This commit is contained in:
Mikhail f. Shiryaev 2023-03-20 20:56:11 +01:00
parent 91e1de2d59
commit 15d02f77cf
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4
2 changed files with 18 additions and 5 deletions

View File

@ -59,11 +59,11 @@ def get_scales(runner_type: str) -> Tuple[int, int]:
"returns the multipliers for scaling down and up ASG by types" "returns the multipliers for scaling down and up ASG by types"
# Scaling down is quicker on the lack of running jobs than scaling up on # Scaling down is quicker on the lack of running jobs than scaling up on
# queue # queue
scale_down = 3 scale_down = 2
scale_up = 5 scale_up = 5
if runner_type == "style-checker": if runner_type == "style-checker":
# the style checkers have so many noise, so it scales up too quickly # the style checkers have so many noise, so it scales up too quickly
scale_down = 2 scale_down = 1
scale_up = 10 scale_up = 10
return scale_down, scale_up return scale_down, scale_up

View File

@ -70,6 +70,9 @@ class TestSetCapacity(unittest.TestCase):
TestCase("w/reserve", 1, 13, 20, [Queue("queued", 17, "w/reserve")], -1), TestCase("w/reserve", 1, 13, 20, [Queue("queued", 17, "w/reserve")], -1),
# Increase capacity # Increase capacity
TestCase("increase", 1, 13, 20, [Queue("queued", 23, "increase")], 15), TestCase("increase", 1, 13, 20, [Queue("queued", 23, "increase")], 15),
TestCase(
"style-checker", 1, 13, 20, [Queue("queued", 33, "style-checker")], 15
),
TestCase("increase", 1, 13, 20, [Queue("queued", 18, "increase")], 14), TestCase("increase", 1, 13, 20, [Queue("queued", 18, "increase")], 14),
TestCase("increase", 1, 13, 20, [Queue("queued", 183, "increase")], 20), TestCase("increase", 1, 13, 20, [Queue("queued", 183, "increase")], 20),
TestCase( TestCase(
@ -85,10 +88,20 @@ class TestSetCapacity(unittest.TestCase):
), ),
TestCase("lower-min", 10, 5, 20, [Queue("queued", 5, "lower-min")], 10), TestCase("lower-min", 10, 5, 20, [Queue("queued", 5, "lower-min")], 10),
# Decrease capacity # Decrease capacity
TestCase("w/reserve", 1, 13, 20, [Queue("queued", 5, "w/reserve")], 11), TestCase("w/reserve", 1, 13, 20, [Queue("queued", 5, "w/reserve")], 9),
TestCase(
"style-checker", 1, 13, 20, [Queue("queued", 5, "style-checker")], 5
),
TestCase("w/reserve", 1, 23, 20, [Queue("queued", 17, "w/reserve")], 20), TestCase("w/reserve", 1, 23, 20, [Queue("queued", 17, "w/reserve")], 20),
TestCase("decrease", 1, 13, 20, [Queue("in_progress", 3, "decrease")], 10), TestCase("decrease", 1, 13, 20, [Queue("in_progress", 3, "decrease")], 8),
TestCase("decrease", 1, 13, 20, [Queue("in_progress", 5, "decrease")], 11), TestCase(
"style-checker",
1,
13,
20,
[Queue("in_progress", 5, "style-checker")],
5,
),
) )
for t in test_cases: for t in test_cases:
self.client.data_helper(t.name, t.min_size, t.desired_capacity, t.max_size) self.client.data_helper(t.name, t.min_size, t.desired_capacity, t.max_size)