Skip to content

Commit 28870f0

Browse files
authored
fix: ensure at least one worker is set based on CPU resources (#5510)
Signed-off-by: Frost Ming <[email protected]>
1 parent ce3c1fc commit 28870f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/_bentoml_sdk/service/factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def __attrs_post_init__(self) -> None:
142142
from bentoml._internal.resource import system_resources
143143

144144
resources = system_resources()
145-
workers = min(16, int(resources["cpu"] / 2) + 1)
145+
workers = min(16, int(resources["cpu"] / 2) or 1)
146146
self.config["workers"] = workers
147147

148148
def __hash__(self):

0 commit comments

Comments
 (0)