Skip to content

Commit a61fee7

Browse files
chrisburraldbr
authored andcommitted
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 b88a3ab commit a61fee7

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
@@ -269,14 +269,25 @@ class SandboxStoreSettings(ServiceSettingsBase):
269269
This name is used within DIRAC to refer to this sandbox storage
270270
endpoint in job descriptions and file catalogs.
271271
"""
272+
273+
s3_max_pool_connections: int = 50
274+
"""Maximum number of connections in the S3 client connection pool.
275+
276+
Higher values allow more parallel S3 requests (e.g. during bulk sandbox
277+
deletion). Default: 50.
278+
"""
279+
272280
_client: S3Client = PrivateAttr()
273281

274282
@contextlib.asynccontextmanager
275283
async def lifetime_function(self) -> AsyncIterator[None]:
276284
async with get_session().create_client(
277285
"s3",
278286
**self.s3_client_kwargs,
279-
config=Config(signature_version="v4", max_pool_connections=50),
287+
config=Config(
288+
signature_version="v4",
289+
max_pool_connections=self.s3_max_pool_connections,
290+
),
280291
) as self._client: # type: ignore
281292
if not await s3_bucket_exists(self._client, self.bucket_name):
282293
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)