From d03dddbdea2ebcb46da8835958680e9a88677b02 Mon Sep 17 00:00:00 2001 From: binwei yang Date: Sun, 22 Mar 2026 00:54:13 -0700 Subject: [PATCH 1/2] add executor pool config --- .../connectors/hive/storage_adapters/s3fs/S3Config.h | 12 ++++++++++++ .../hive/storage_adapters/s3fs/S3FileSystem.cpp | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/velox/connectors/hive/storage_adapters/s3fs/S3Config.h b/velox/connectors/hive/storage_adapters/s3fs/S3Config.h index f327fe2008b3..2e5bb18cc6a7 100644 --- a/velox/connectors/hive/storage_adapters/s3fs/S3Config.h +++ b/velox/connectors/hive/storage_adapters/s3fs/S3Config.h @@ -77,6 +77,7 @@ class S3Config { kUseProxyFromEnv, kCredentialsProvider, kIMDSEnabled, + kExecutorPoolSize, kEnd }; @@ -116,6 +117,8 @@ class S3Config { {Keys::kCredentialsProvider, std::make_pair("aws-credentials-provider", std::nullopt)}, {Keys::kIMDSEnabled, std::make_pair("aws-imds-enabled", "true")}, + {Keys::kExecutorPoolSize, + std::make_pair("executor-pool-size", std::nullopt)}, }; return config; } @@ -251,6 +254,15 @@ class S3Config { return folly::to(value); } + /// Executor pool size for async operations. + std::optional executorPoolSize() const { + auto val = config_.find(Keys::kExecutorPoolSize)->second; + if (val.has_value()) { + return folly::to(val.value()); + } + return std::optional(); + } + private: std::unordered_map> config_; std::string payloadSigningPolicy_; diff --git a/velox/connectors/hive/storage_adapters/s3fs/S3FileSystem.cpp b/velox/connectors/hive/storage_adapters/s3fs/S3FileSystem.cpp index 114bb457ef6c..2bd4510e5b02 100644 --- a/velox/connectors/hive/storage_adapters/s3fs/S3FileSystem.cpp +++ b/velox/connectors/hive/storage_adapters/s3fs/S3FileSystem.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -299,6 +300,9 @@ class S3FileSystem::Impl { inferPayloadSign(s3Config.payloadSigningPolicy()); auto credentialsProvider = getCredentialsProvider(s3Config); + if (s3Config.executorPoolSize().has_value() && s3Config.executorPoolSize().value()>0) { + clientConfig.executor = Aws::MakeShared(nullptr, s3Config.executorPoolSize().value()); + } client_ = std::make_shared( credentialsProvider, nullptr /* endpointProvider */, clientConfig); From 56f6314b159862eff4c6e62dc6a5d8aacdb1d3ea Mon Sep 17 00:00:00 2001 From: binwei yang Date: Sun, 22 Mar 2026 01:05:15 -0700 Subject: [PATCH 2/2] add to config doc --- velox/docs/configs.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/velox/docs/configs.rst b/velox/docs/configs.rst index c39ad895820b..2092adf5fcc5 100644 --- a/velox/docs/configs.rst +++ b/velox/docs/configs.rst @@ -1054,6 +1054,10 @@ Each query can override the config by setting corresponding query session proper - true - AWS Instance Metadata Service (IMDS) is an AWS EC2 instance component used by applications to securely access metadata. We must disable it on other instances to avoid high first-time read latency from S3 compatible object storages. + * - hive.s3.executor-pool-size + - integer + - + - Define the executor size in the AWS thread pool which is used to perform S3 requests. 0 means disabled. Bucket Level Configuration """"""""""""""""""""""""""