This is an automated email from the ASF dual-hosted git repository.
karan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new a55b8cbcc96 Adjust formula for Netty worker threads. (#18493)
a55b8cbcc96 is described below
commit a55b8cbcc96c787f79e15c42912c8bf107475f08
Author: Gian Merlino <[email protected]>
AuthorDate: Mon Sep 15 01:32:33 2025 -0700
Adjust formula for Netty worker threads. (#18493)
* Adjust formula for Netty worker threads.
Generally, the new formula leads to much fewer threads at
small processor counts, and similar numbers of threads
at large processor counts.
* Update documentation.
---
docs/configuration/index.md | 6 +++---
.../java/org/apache/druid/guice/http/DruidHttpClientConfig.java | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/configuration/index.md b/docs/configuration/index.md
index 4c11e125374..394883a1b9b 100644
--- a/docs/configuration/index.md
+++ b/docs/configuration/index.md
@@ -702,7 +702,7 @@ All Druid components can communicate with each other over
HTTP.
|`druid.global.http.compressionCodec`|Compression codec to communicate with
others. May be "gzip" or "identity".|`gzip`|
|`druid.global.http.readTimeout`|The timeout for data reads.|`PT15M`|
|`druid.global.http.unusedConnectionTimeout`|The timeout for idle connections
in connection pool. The connection in the pool will be closed after this
timeout and a new one will be established. This timeout should be less than
`druid.global.http.readTimeout`. Set this timeout = ~90% of
`druid.global.http.readTimeout`|`PT4M`|
-|`druid.global.http.numMaxThreads`|Maximum number of I/O worker
threads|`max(10, ((number of cores * 17) / 16 + 2) + 30)`|
+|`druid.global.http.numMaxThreads`|Maximum number of I/O worker
threads|`(number of cores) * 3 / 2 + 1`|
|`druid.global.http.clientConnectTimeout`|The timeout (in milliseconds) for
establishing client connections.|500|
### Common endpoints configuration
@@ -1788,7 +1788,7 @@ client has the following configuration options.
|`druid.broker.http.readTimeout`|The timeout for data reads from Historical
servers and real-time tasks.|`PT15M`|
|`druid.broker.http.unusedConnectionTimeout`|The timeout for idle connections
in connection pool. The connection in the pool will be closed after this
timeout and a new one will be established. This timeout should be less than
`druid.broker.http.readTimeout`. Set this timeout = ~90% of
`druid.broker.http.readTimeout`|`PT4M`|
|`druid.broker.http.maxQueuedBytes`|Maximum number of bytes queued per query
before exerting
[backpressure](../operations/basic-cluster-tuning.md#broker-backpressure) on
channels to the data servers.<br /><br />Similar to
`druid.server.http.maxScatterGatherBytes`, except that `maxQueuedBytes`
triggers
[backpressure](../operations/basic-cluster-tuning.md#broker-backpressure)
instead of query failure. Set to zero to disable. You can override this setting
by using the [`maxQueuedBytes` quer [...]
-|`druid.broker.http.numMaxThreads`|`Maximum number of I/O worker
threads|max(10, ((number of cores * 17) / 16 + 2) + 30)`|
+|`druid.broker.http.numMaxThreads`|`Maximum number of I/O worker
threads|(number of cores) * 3 / 2 + 1`|
|`druid.broker.http.clientConnectTimeout`|The timeout (in milliseconds) for
establishing client connections.|500|
@@ -2295,7 +2295,7 @@ Supported query contexts:
|`druid.router.http.numConnections`|Size of connection pool for the Router to
connect to Broker processes. If there are more queries than this number that
all need to speak to the same process, then they will queue up.|`20`|
|`druid.router.http.eagerInitialization`|Indicates that http connections from
Router to Broker should be eagerly initialized. If set to true,
`numConnections` connections are created upon initialization|`true`|
|`druid.router.http.readTimeout`|The timeout for data reads from Broker
processes.|`PT15M`|
-|`druid.router.http.numMaxThreads`|Maximum number of worker threads to handle
HTTP requests and responses|`max(10, ((number of cores * 17) / 16 + 2) + 30)`|
+|`druid.router.http.numMaxThreads`|Maximum number of worker threads to handle
HTTP requests and responses|`(number of cores) * 3 / 2 + 1`|
|`druid.router.http.numRequestsQueued`|Maximum number of requests that may be
queued to a destination|`1024`|
|`druid.router.http.requestBuffersize`|Size of the content buffer for
receiving requests. These buffers are only used for active connections that
have requests with bodies that will not fit within the header buffer|`8 * 1024`|
|`druid.router.http.clientConnectTimeout`|The timeout (in milliseconds) for
establishing client connections.|500|
diff --git
a/server/src/main/java/org/apache/druid/guice/http/DruidHttpClientConfig.java
b/server/src/main/java/org/apache/druid/guice/http/DruidHttpClientConfig.java
index ff5025701bc..e228bfa3ac5 100644
---
a/server/src/main/java/org/apache/druid/guice/http/DruidHttpClientConfig.java
+++
b/server/src/main/java/org/apache/druid/guice/http/DruidHttpClientConfig.java
@@ -48,7 +48,7 @@ public class DruidHttpClientConfig
@JsonProperty
@Min(1)
- private int numMaxThreads = Math.max(10,
(JvmUtils.getRuntimeInfo().getAvailableProcessors() * 17) / 16 + 2) + 30;
+ private int numMaxThreads =
JvmUtils.getRuntimeInfo().getAvailableProcessors() * 3 / 2 + 1;
@JsonProperty
@Min(1)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]