Skip to content

Commit

Permalink
Reduce number of threads to reduce memory pressure (#1780)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbowen-usds committed Aug 17, 2022
1 parent 011dc1a commit 034a366
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions data/data-pipeline/data_pipeline/etl/runner.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import importlib
import concurrent.futures
import typing
import os

from data_pipeline.etl.score.etl_score import ScoreETL
from data_pipeline.etl.score.etl_score_geo import GeoScoreETL
Expand Down Expand Up @@ -76,8 +77,8 @@ def etl_runner(dataset_to_run: str = None) -> None:
None
"""
dataset_list = _get_datasets_to_run(dataset_to_run)

with concurrent.futures.ThreadPoolExecutor() as executor:
max_workers = min(32, os.cpu_count() + 4)//2
with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor:
futures = {
executor.submit(_run_one_dataset, dataset=dataset)
for dataset in dataset_list
Expand Down

0 comments on commit 034a366

Please sign in to comment.