Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Broker] Increase default numHttpServerThreads value to 50 to prevent Admin API unavailability #14320

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions conf/broker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ numIOThreads=
# such as init zookeeper client, get namespace policies from zookeeper etc. It also used to split bundle. Default is 8
numOrderedExecutorThreads=8

# Number of threads to use for HTTP requests processing. Default is set to 2 * Runtime.getRuntime().availableProcessors()
numHttpServerThreads=
# Maximum number of threads to use for HTTP requests processing.
# Default is set to 200. Initial number of threads is 8 when numHttpServerThreads >= 8.
numHttpServerThreads=200

# Number of thread pool size to use for pulsar broker service.
# The executor in thread pool will do basic broker operation like load/unload bundle, update managedLedgerConfig,
Expand Down Expand Up @@ -1430,4 +1431,4 @@ tlsEnabled=false

# Enable Key_Shared subscription (default is enabled)
# @deprecated since 2.8.0 subscriptionTypesEnabled is preferred over subscriptionKeySharedEnable.
subscriptionKeySharedEnable=true
subscriptionKeySharedEnable=true
8 changes: 4 additions & 4 deletions conf/proxy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ httpReverseProxyConfigs=
# so that clients see the data as soon as possible.
httpOutputBufferSize=32768

# Number of threads to use for HTTP requests processing. Default is
# 2 * Runtime.getRuntime().availableProcessors()
httpNumThreads=
# Maximum number of threads to use for HTTP requests processing.
# Default is set to 200. Initial number of threads is 8 when numHttpServerThreads >= 8.
httpNumThreads=200

# Enable the enforcement of limits on the incoming HTTP requests
httpRequestsLimitEnabled=false
Expand Down Expand Up @@ -269,4 +269,4 @@ zookeeperSessionTimeoutMs=-1

# ZooKeeper cache expiry time in seconds
# Deprecated: use metadataStoreCacheExpirySeconds
zooKeeperCacheExpirySeconds=-1
zooKeeperCacheExpirySeconds=-1
5 changes: 3 additions & 2 deletions conf/standalone.conf
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ numIOThreads=
# such as init zookeeper client, get namespace policies from zookeeper etc. It also used to split bundle. Default is 8
numOrderedExecutorThreads=8

# Number of threads to use for HTTP requests processing. Default is set to 2 * Runtime.getRuntime().availableProcessors()
numHttpServerThreads=
# Maximum number of threads to use for HTTP requests processing.
# Default is set to 200. Initial number of threads is 8 when numHttpServerThreads >= 8.
numHttpServerThreads=200

# Number of thread pool size to use for pulsar broker service.
# The executor in thread pool will do basic broker operation like load/unload bundle, update managedLedgerConfig,
Expand Down
5 changes: 3 additions & 2 deletions deployment/terraform-ansible/templates/broker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ advertisedAddress={{ hostvars[inventory_hostname].private_ip }}
# Number of threads to use for Netty IO. Default is set to 2 * Runtime.getRuntime().availableProcessors()
numIOThreads=

# Number of threads to use for HTTP requests processing. Default is set to 2 * Runtime.getRuntime().availableProcessors()
numHttpServerThreads=
# Maximum number of threads to use for HTTP requests processing.
# Default is set to 200. Initial number of threads is 8 when numHttpServerThreads >= 8.
numHttpServerThreads=200

# Flag to control features that are meant to be used when running in standalone mode
isRunningStandalone=
Expand Down
6 changes: 3 additions & 3 deletions deployment/terraform-ansible/templates/proxy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ httpReverseProxyConfigs=
# so that clients see the data as soon as possible.
httpOutputBufferSize=32768

# Number of threads to use for HTTP requests processing. Default is
# 2 * Runtime.getRuntime().availableProcessors()
httpNumThreads=
# Maximum number of threads to use for HTTP requests processing.
# Default is set to 200. Initial number of threads is 8 when numHttpServerThreads >= 8.
httpNumThreads=200

### --- Token Authentication Provider --- ###

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,10 @@ public class ServiceConfiguration implements PulsarConfiguration {

@FieldContext(
category = CATEGORY_SERVER,
doc = "Number of threads to use for HTTP requests processing"
+ " Default is set to `2 * Runtime.getRuntime().availableProcessors()`"
)
// Use at least 8 threads to avoid having Jetty go into threads starving and
// having the possibility of getting into a deadlock where a Jetty thread is
// waiting for another HTTP call to complete in same thread.
private int numHttpServerThreads = Math.max(8, 2 * Runtime.getRuntime().availableProcessors());
doc = "Maximum number of threads to use for HTTP requests processing"
+ " Default is set to 200. Initial number of threads is 8 when numHttpServerThreads >= 8."
)
private int numHttpServerThreads = 200;

@FieldContext(
category = CATEGORY_SERVER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,9 +601,10 @@ public class ProxyConfiguration implements PulsarConfiguration {
@FieldContext(
minValue = 1,
category = CATEGORY_HTTP,
doc = "Number of threads to use for HTTP requests processing"
doc = "Maximum number of threads to use for HTTP requests processing"
+ " Default is set to 200. Initial number of threads is 8 when numHttpServerThreads >= 8."
)
private int httpNumThreads = Math.max(8, 2 * Runtime.getRuntime().availableProcessors());
private int httpNumThreads = 200;

@FieldContext(
category = CATEGORY_SERVER,
Expand Down
6 changes: 3 additions & 3 deletions pulsar-proxy/src/test/resources/proxy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ httpReverseProxyConfigs=
# so that clients see the data as soon as possible.
httpOutputBufferSize=32768

# Number of threads to use for HTTP requests processing. Default is
# 2 * Runtime.getRuntime().availableProcessors()
httpNumThreads=
# Maximum number of threads to use for HTTP requests processing.
# Default is set to 200. Initial number of threads is 8 when numHttpServerThreads >= 8.
httpNumThreads=200

# Enable the enforcement of limits on the incoming HTTP requests
httpRequestsLimitEnabled=false
Expand Down