Skip to content

Commit 8c876f3

Browse files
yuvipandajnywong
authored andcommitted
Add 2% wiggle room to resource allocations
In 2i2c-org#6309, we discovered that some of our resource allocations were now outdated. This adds a 2% wiggle room that should help with that
1 parent 9c6c073 commit 8c876f3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

deployer/commands/generate/resource_allocation/generate_choices.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ def proportional_memory_strategy(
4949
# as well as daemonsets we run on every node. This represents the resources that are available
5050
# for user pods.
5151

52-
# FIXME: Add some more more wiggle room here
53-
available_node_mem = nodeinfo["available"]["memory"]
54-
available_node_cpu = nodeinfo["available"]["cpu"]
52+
WIGGLE_ROOM = 0.02
53+
54+
available_node_mem = nodeinfo["available"]["memory"] * (1 - WIGGLE_ROOM)
55+
available_node_cpu = nodeinfo["available"]["cpu"] * (1 - WIGGLE_ROOM)
5556

5657
# Only show one digit after . for CPU, but round *down* not up so we never
5758
# say they are getting more CPU than our limit is set to. We multiply & divide

0 commit comments

Comments
 (0)