Skip to content

Commit

Permalink
Fix max process workers flag (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
drobison00 authored Feb 27, 2025
1 parent 1e3493a commit 48d0fb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nv_ingest/util/multi_processing/mp_pool_singleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def __new__(cls):
if cls._instance is None:
max_worker_limit = int(os.environ.get("MAX_INGEST_PROCESS_WORKERS", -1))
cls._instance = super(ProcessWorkerPoolSingleton, cls).__new__(cls)
max_workers = min(max_worker_limit, math.floor(max(1, len(os.sched_getaffinity(0)) * 0.4)))
max_workers = math.floor(max(1, len(os.sched_getaffinity(0)) * 0.4))
if (max_worker_limit > 0) and (max_workers > max_worker_limit):
max_workers = max_worker_limit
logger.debug("Creating ProcessWorkerPoolSingleton instance with max workers: %d", max_workers)
Expand Down

0 comments on commit 48d0fb5

Please sign in to comment.