We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cdb051c commit 5b1102cCopy full SHA for 5b1102c
webapp/app.py
@@ -111,7 +111,11 @@ def check_memory():
111
memory limit amount, you have to consider it like a check written to your
112
account, you never know when it may be cashed.
113
"""
114
- remaining_budget = initial_memory_budget - len(docker_client.containers()) * CONTAINER_MEM_LIMIT
+ # the overbook factor says that each container is unlikely to be using its
115
+ # full memory limit, and so this is a guestimate of how much you can overbook
116
+ # your memory
117
+ overbook_factor = .8
118
+ remaining_budget = initial_memory_budget - len(docker_client.containers()) * CONTAINER_MEM_LIMIT * overbook_factor
119
if remaining_budget < MEM_MIN:
120
raise ContainerException("Sorry, not enough free memory to start your container")
121
0 commit comments