Skip to content

Commit d23a526

Browse files
authored
[Ready for review] make default s3 worker count configurable (#1759)
* make default s3 worker count configurable * change comment wording
1 parent 0f4ef1a commit d23a526

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

metaflow/metaflow_config.py

+3
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@
8181
# so setting it to 0 means each operation will be tried once.
8282
S3_RETRY_COUNT = from_conf("S3_RETRY_COUNT", 7)
8383

84+
# Number of concurrent S3 processes for parallel operations.
85+
S3_WORKER_COUNT = from_conf("S3_WORKER_COUNT", 64)
86+
8487
# Number of retries on *transient* failures (such as SlowDown errors). Note
8588
# that if after S3_TRANSIENT_RETRY_COUNT times, all operations haven't been done,
8689
# it will try up to S3_RETRY_COUNT again so the total number of tries can be up to

metaflow/plugins/datatools/s3/s3op.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@
4444
TRANSIENT_RETRY_START_LINE,
4545
)
4646
import metaflow.tracing as tracing
47-
48-
NUM_WORKERS_DEFAULT = 64
47+
from metaflow.metaflow_config import (
48+
S3_WORKER_COUNT,
49+
)
4950

5051
DOWNLOAD_FILE_THRESHOLD = 2 * TransferConfig().multipart_threshold
5152
DOWNLOAD_MAX_CHUNK = 2 * 1024 * 1024 * 1024 - 1
@@ -656,7 +657,7 @@ def common_options(func):
656657
)
657658
@click.option(
658659
"--num-workers",
659-
default=NUM_WORKERS_DEFAULT,
660+
default=S3_WORKER_COUNT,
660661
show_default=True,
661662
help="Number of concurrent connections.",
662663
)

0 commit comments

Comments
 (0)