Skip to content

Commit 4837983

Browse files
committed
Limit concurrent mode to the number of cpus
1 parent 018345b commit 4837983

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/guidellm/scheduler/strategy.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,9 @@ def processes_limit(self) -> int:
226226
:return: {self.streams} for the concurrent scheduling strategy to limit
227227
the worker processes to the number of streams.
228228
"""
229-
return self.streams
229+
cpu_cores = os.cpu_count() or 1
230+
231+
return min(max(1, cpu_cores - 1), self.streams)
230232

231233
@property
232234
def queued_requests_limit(self) -> int:

0 commit comments

Comments
 (0)