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

Custom jetty thread pool? #152

Open
imperio-wxm opened this issue Oct 22, 2019 · 0 comments
Open

Custom jetty thread pool? #152

imperio-wxm opened this issue Oct 22, 2019 · 0 comments

Comments

@imperio-wxm
Copy link

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.

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

// 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?

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();
  }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant