confluentinc / confluentinc/rest-utils

Custom jetty thread pool?

Open
#152 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
25
Forks
211
Avg merge
14h 33m
Merged PRs (30d)
3

Description

I read the source code for starting the jetty server, and there is no configuration for the jetty connection pool, but the default value is used.

```java
server = new Server() {
@Override
protected void doStop() throws Exception {
super.doStop();
Application.this.metrics.close();
Application.this.doShutdown();
Application.this.shutdownLatch.countDown();
}
};
```
The default configuration of the jetty thread pool is `max=200` `min=8`.
In the case of too much concurrency, jetty performance is not guaranteed

```java
// jetty source code
public QueuedThreadPool()
{
this(200);
}
public QueuedThreadPool(@Name("maxThreads") int maxThreads)
{
this(maxThreads, 8);
}
```

**If I increase the thread pool size properly, will it affect?**

```java
int maxThreads = 1000; // value from config file
int minThreads = 50; // value from config file
QueuedThreadPool queuedThreadPool = new QueuedThreadPool(maxThreads, minThreads);
server = new Server(queuedThreadPool) {
@Override
protected void doStop() throws Exception {
super.doStop();
Application.this.metrics.close();
Application.this.doShutdown();
Application.this.shutdownLatch.countDown();
}
};
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.