Skip to content

Commit c90f8ce

Browse files
committed
fix: make S3 connection pool size configurable
Add s3_max_pool_connections setting (default 50) to SandboxStoreSettings, configurable via DIRACX_SANDBOX_STORE_S3_MAX_POOL_CONNECTIONS.
1 parent 1472e33 commit c90f8ce

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

diracx-core/src/diracx/core/settings.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,14 +268,25 @@ class SandboxStoreSettings(ServiceSettingsBase):
268268
This name is used within DIRAC to refer to this sandbox storage
269269
endpoint in job descriptions and file catalogs.
270270
"""
271+
272+
s3_max_pool_connections: int = 50
273+
"""Maximum number of connections in the S3 client connection pool.
274+
275+
Higher values allow more parallel S3 requests (e.g. during bulk sandbox
276+
deletion). Default: 50.
277+
"""
278+
271279
_client: S3Client = PrivateAttr()
272280

273281
@contextlib.asynccontextmanager
274282
async def lifetime_function(self) -> AsyncIterator[None]:
275283
async with get_session().create_client(
276284
"s3",
277285
**self.s3_client_kwargs,
278-
config=Config(signature_version="v4", max_pool_connections=50),
286+
config=Config(
287+
signature_version="v4",
288+
max_pool_connections=self.s3_max_pool_connections,
289+
),
279290
) as self._client: # type: ignore
280291
if not await s3_bucket_exists(self._client, self.bucket_name):
281292
if not self.auto_create_bucket:

docs/admin/reference/env-variables.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,15 @@ Logical name of the Storage Element for the sandbox store.
148148
This name is used within DIRAC to refer to this sandbox storage
149149
endpoint in job descriptions and file catalogs.
150150

151+
### `DIRACX_SANDBOX_STORE_S3_MAX_POOL_CONNECTIONS`
152+
153+
*Optional*, default value: `50`
154+
155+
Maximum number of connections in the S3 client connection pool.
156+
157+
Higher values allow more parallel S3 requests (e.g. during bulk sandbox
158+
deletion). Default: 50.
159+
151160
## OTELSettings
152161

153162
Settings for the Open Telemetry Configuration.

0 commit comments

Comments
 (0)