I'm using spring+jetty. I'm configuring jetty:
@Bean
public JettyEmbeddedServletContainerFactory jettyEmbeddedServletContainerFactory() {
final JettyEmbeddedServletContainerFactory factory = new JettyEmbeddedServletContainerFactory(port);
factory.addServerCustomizers((Server server) -> {
final QueuedThreadPool threadPool = server.getBean(QueuedThreadPool.class);
threadPool.setMinThreads(minThreads);
threadPool.setMaxThreads(maxThreads);
threadPool.setIdleTimeout(1000);
});
return factory;
}
It works, but strange.
- Set minThreads=1, maxThreads=5, and it doesn't processing connections.
- Set minThreads=1, maxThreads=6, and it processing only one connection
- Set minThreads=1, maxThreads=7, and it processing only two connections. When I say processing, I mean, that it accepts connections, but do nothing. Doesn't reply, doesn't abort them. (I think they are in a queue)
So, where are my 5 threads?