Skip to content

Commit

Permalink
Make number of download threads configurable
Browse files Browse the repository at this point in the history
and reduce them to 3 by default.
  • Loading branch information
gregorjerse committed Dec 5, 2024
1 parent 6405014 commit 1eee560
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Changed
-------
- Make processing container startup script ``Python`` 3.12 compatible
- Fix stop null executor processing in the preparation phase
- Reduce the maximal number of threads for downolad data in the init container

Fixed
-----
Expand Down
7 changes: 5 additions & 2 deletions resolwe/flow/executors/init_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
DOWNLOAD_WAITING_TIMEOUT = 60 # in seconds
RETRIES = 5

# Max threads to use for data download.
MAX_DOWNLOAD_THREADS = int(os.environ.get("GENIALIS_MAX_DOWNLOAD_THREADS", 3))

# Configure container logger. All logs are output to stdout for further
# processing.
# The log level defaults to debug except for boto and google loggers, which
Expand Down Expand Up @@ -112,8 +115,8 @@ async def transfer_inputs(communicator: BaseCommunicator, missing_data: dict):

try:
for connector_name in objects_to_transfer:
min_threads = 5
max_threads = 20
min_threads = 1
max_threads = MAX_DOWNLOAD_THREADS
# Use from min_threads to max_threads threads. Assume each thread
# can handle at least 100 files in reasonable time.
files_count = len(objects_to_transfer[connector_name])
Expand Down

0 comments on commit 1eee560

Please sign in to comment.