Skip to content

Commit b7c7aee

Browse files
author
liwang
committed
ZOOKEEPER-4951: Optimize the default Prometheus max queue size
Author: Li Wang <[email protected]>
1 parent 9d1d25c commit b7c7aee

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

zookeeper-docs/src/main/resources/markdown/zookeeperAdmin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2275,7 +2275,7 @@ options are used to configure the [AdminServer](#sc_adminserver).
22752275
* *metricsProvider.maxQueueSize* :
22762276
**New in 3.7.1:**
22772277
The max queue size for Prometheus summary metrics reporting task.
2278-
Default value is 1000000.
2278+
Default value is 10000.
22792279

22802280
* *metricsProvider.workerShutdownTimeoutMs* :
22812281
**New in 3.7.1:**

zookeeper-metrics-providers/zookeeper-prometheus-metrics/src/main/java/org/apache/zookeeper/metrics/prometheus/PrometheusMetricsProvider.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public class PrometheusMetricsProvider implements MetricsProvider {
8484

8585
/**
8686
* The max queue size for Prometheus summary metrics reporting task.
87-
* Default value is 1000000.
87+
* Default value is 10000.
8888
*/
8989
static final String MAX_QUEUE_SIZE = "maxQueueSize";
9090

@@ -111,7 +111,7 @@ public class PrometheusMetricsProvider implements MetricsProvider {
111111
private final MetricsServletImpl servlet = new MetricsServletImpl();
112112
private final Context rootContext = new Context();
113113
private int numWorkerThreads = 1;
114-
private int maxQueueSize = 1000000;
114+
private int maxQueueSize = 10000;
115115
private long workerShutdownTimeoutMs = 1000;
116116
private Optional<ExecutorService> executorOptional = Optional.empty();
117117

@@ -161,7 +161,7 @@ public void configure(Properties configuration) throws MetricsProviderLifeCycleE
161161
this.numWorkerThreads = Integer.parseInt(
162162
configuration.getProperty(NUM_WORKER_THREADS, "1"));
163163
this.maxQueueSize = Integer.parseInt(
164-
configuration.getProperty(MAX_QUEUE_SIZE, "1000000"));
164+
configuration.getProperty(MAX_QUEUE_SIZE, "10000"));
165165
this.workerShutdownTimeoutMs = Long.parseLong(
166166
configuration.getProperty(WORKER_SHUTDOWN_TIMEOUT_MS, "1000"));
167167
}

0 commit comments

Comments
 (0)