Skip to content

Commit

Permalink
Add timeouts and retries.
Browse files Browse the repository at this point in the history
  • Loading branch information
ktlim committed Oct 2, 2024
1 parent b5e72fa commit f47cf54
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion python/s3daemon/s3daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,23 @@
import aiobotocore.session
import botocore

max_connections = int(os.environ.get("S3DAEMON_MAX_CONNECTIONS", 25))
connect_timeout = float(os.environ.get("S3DAEMON_CONNECT_TIMEOUT", 5.0))
max_retries = int(os.environ.get("S3DAEMON_MAX_RETRIES", 2))

config = botocore.config.Config(
max_pool_connections=25,
max_pool_connections=max_connections,
tcp_keepalive=True,
connect_timeout=connect_timeout,
s3=dict(
payload_signing_enabled=False,
addressing_style="path",
),
retries=dict(
total_max_attempts=max_retries,
mode="adaptive",
),
disable_request_compression=True,
)

host = os.environ.get("S3DAEMON_HOST", "localhost")
Expand Down

0 comments on commit f47cf54

Please sign in to comment.