From bf26863b03bab6065cbe1ba8a847a8d1de5b4ae1 Mon Sep 17 00:00:00 2001 From: Demogorgon314 Date: Wed, 27 Apr 2022 10:07:42 +0800 Subject: [PATCH 1/4] Add config of IO and acceptor threads in proxy --- conf/proxy.conf | 6 ++++++ site2/docs/reference-configuration.md | 2 ++ 2 files changed, 8 insertions(+) diff --git a/conf/proxy.conf b/conf/proxy.conf index 8a67e50782724..920c1fa8ebf2f 100644 --- a/conf/proxy.conf +++ b/conf/proxy.conf @@ -72,6 +72,12 @@ webServicePort=8080 # Port to use to server HTTPS request webServicePortTls= +# Number of threads to use for Netty IO. Default is set to `2 * Runtime.getRuntime().availableProcessors()` +numIOThreads= + +# Number of threads to use for Netty Acceptor. Default is set to `1` +numAcceptorThreads= + ### --- TLS config variables --- ### ## Note that some of the above TLS configs also apply to the KeyStore TLS configuration. diff --git a/site2/docs/reference-configuration.md b/site2/docs/reference-configuration.md index 53709fe06e39d..fab6bb14ecf05 100644 --- a/site2/docs/reference-configuration.md +++ b/site2/docs/reference-configuration.md @@ -817,6 +817,8 @@ The [Pulsar proxy](concepts-architecture-overview.md#pulsar-proxy) can be config |tokenAudienceClaim| The token audience "claim" name, e.g. "aud". It is used to get the audience from token. If it is not set, the audience is not verified. || | tokenAudience | The token audience stands for this broker. The field `tokenAudienceClaim` of a valid token need contains this parameter.| | |haProxyProtocolEnabled | Enable or disable the [HAProxy](http://www.haproxy.org/) protocol. |false| +| numIOThreads | Number of threads to use for Netty IO. | 2 * Runtime.getRuntime().availableProcessors() | +| numAcceptorThreads | Number of threads to use for Netty Acceptor. | 1 | #### Deprecated parameters of Pulsar proxy The following parameters have been deprecated in the `conf/proxy.conf` file. From 8f40086a6dd0b6067c7d08cb0521508196427794 Mon Sep 17 00:00:00 2001 From: Demogorgon314 Date: Thu, 28 Apr 2022 10:20:21 +0800 Subject: [PATCH 2/4] Update doc --- conf/proxy.conf | 4 ++-- .../org/apache/pulsar/proxy/server/ProxyConfiguration.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conf/proxy.conf b/conf/proxy.conf index 920c1fa8ebf2f..653a8a9ca61cf 100644 --- a/conf/proxy.conf +++ b/conf/proxy.conf @@ -72,10 +72,10 @@ webServicePort=8080 # Port to use to server HTTPS request webServicePortTls= -# Number of threads to use for Netty IO. Default is set to `2 * Runtime.getRuntime().availableProcessors()` +# Number of threads used for Netty IO. Default is set to `2 * Runtime.getRuntime().availableProcessors()` numIOThreads= -# Number of threads to use for Netty Acceptor. Default is set to `1` +# Number of threads used for Netty Acceptor. Default is set to `1` numAcceptorThreads= ### --- TLS config variables --- ### diff --git a/pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConfiguration.java b/pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConfiguration.java index faec6b6da07c1..b6371c55f93cb 100644 --- a/pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConfiguration.java +++ b/pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConfiguration.java @@ -636,14 +636,14 @@ public class ProxyConfiguration implements PulsarConfiguration { @FieldContext( category = CATEGORY_SERVER, - doc = "Number of threads to use for Netty IO." + doc = "Number of threads used for Netty IO." + " Default is set to `2 * Runtime.getRuntime().availableProcessors()`" ) private int numIOThreads = 2 * Runtime.getRuntime().availableProcessors(); @FieldContext( category = CATEGORY_SERVER, - doc = "Number of threads to use for Netty Acceptor." + doc = "Number of threads used for Netty Acceptor." + " Default is set to `1`" ) private int numAcceptorThreads = 1; From b134310bd246885470520cfddd7783afe6cf1fc7 Mon Sep 17 00:00:00 2001 From: Kai Wang Date: Thu, 28 Apr 2022 10:15:54 +0800 Subject: [PATCH 3/4] Update site2/docs/reference-configuration.md Co-authored-by: Anonymitaet <50226895+Anonymitaet@users.noreply.github.com> --- site2/docs/reference-configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site2/docs/reference-configuration.md b/site2/docs/reference-configuration.md index fab6bb14ecf05..87809b021ac96 100644 --- a/site2/docs/reference-configuration.md +++ b/site2/docs/reference-configuration.md @@ -817,7 +817,7 @@ The [Pulsar proxy](concepts-architecture-overview.md#pulsar-proxy) can be config |tokenAudienceClaim| The token audience "claim" name, e.g. "aud". It is used to get the audience from token. If it is not set, the audience is not verified. || | tokenAudience | The token audience stands for this broker. The field `tokenAudienceClaim` of a valid token need contains this parameter.| | |haProxyProtocolEnabled | Enable or disable the [HAProxy](http://www.haproxy.org/) protocol. |false| -| numIOThreads | Number of threads to use for Netty IO. | 2 * Runtime.getRuntime().availableProcessors() | +| numIOThreads | Number of threads used for Netty IO. | 2 * Runtime.getRuntime().availableProcessors() | | numAcceptorThreads | Number of threads to use for Netty Acceptor. | 1 | #### Deprecated parameters of Pulsar proxy From 8c5f4b0f9f96c7325a966472350bbd0b0717d152 Mon Sep 17 00:00:00 2001 From: Kai Wang Date: Thu, 28 Apr 2022 10:16:39 +0800 Subject: [PATCH 4/4] Update site2/docs/reference-configuration.md --- site2/docs/reference-configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site2/docs/reference-configuration.md b/site2/docs/reference-configuration.md index 87809b021ac96..b4565cdc58492 100644 --- a/site2/docs/reference-configuration.md +++ b/site2/docs/reference-configuration.md @@ -818,7 +818,7 @@ The [Pulsar proxy](concepts-architecture-overview.md#pulsar-proxy) can be config | tokenAudience | The token audience stands for this broker. The field `tokenAudienceClaim` of a valid token need contains this parameter.| | |haProxyProtocolEnabled | Enable or disable the [HAProxy](http://www.haproxy.org/) protocol. |false| | numIOThreads | Number of threads used for Netty IO. | 2 * Runtime.getRuntime().availableProcessors() | -| numAcceptorThreads | Number of threads to use for Netty Acceptor. | 1 | +| numAcceptorThreads | Number of threads used for Netty Acceptor. | 1 | #### Deprecated parameters of Pulsar proxy The following parameters have been deprecated in the `conf/proxy.conf` file.