Skip to content

Commit 50443a6

Browse files
committed
ensure autoscaling counts at least 1 CPU per task
1 parent b50374a commit 50443a6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

services/autoscaling/src/simcore_service_autoscaling/modules/cluster_scaling/_utils_computational.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616

1717
def resources_from_dask_task(task: DaskTask) -> Resources:
1818
return Resources(
19-
cpus=task.required_resources.get("CPU", _DEFAULT_MAX_CPU),
19+
cpus=min(
20+
task.required_resources.get("CPU", _DEFAULT_MAX_CPU), 1.0
21+
), # NOTE: dask-workers use 1 thread per CPU so going below will not scale
2022
ram=task.required_resources.get("RAM", _DEFAULT_MAX_RAM),
2123
)
2224

0 commit comments

Comments
 (0)