Commit 6e3b034d authored by Costin Grigoras's avatar Costin Grigoras
Browse files

Separate executors for work and SSL handling

parent c4fa3efb
......@@ -80,11 +80,15 @@ public class DispatchSSLServerNIO implements Runnable {
private static final AtomicInteger threadNo = new AtomicInteger();
private static final AtomicInteger sslThreadNo = new AtomicInteger();
/**
* Thread pool handling messages
*/
private static ThreadPoolExecutor executor = new CachedThreadPool(200, 1, TimeUnit.MINUTES, (r) -> new Thread(r, "DispatchSSLServerNIO - " + threadNo.incrementAndGet()));
private static ThreadPoolExecutor sslExecutor = new CachedThreadPool(32, 1, TimeUnit.MINUTES, (r) -> new Thread(r, "SSLNegociator- " + sslThreadNo.incrementAndGet()));
private static final int defaultPort = 8098;
private static String serviceName = "apiService";
......@@ -112,6 +116,12 @@ public class DispatchSSLServerNIO implements Runnable {
names.add("executorActiveCount");
values.add(Double.valueOf(executor.getActiveCount()));
names.add("sslExecutorPoolSize");
values.add(Double.valueOf(sslExecutor.getPoolSize()));
names.add("sslExecutorActiveCount");
values.add(Double.valueOf(sslExecutor.getActiveCount()));
names.add("eQueueSize");
values.add(Double.valueOf(taskQueue.size()));
});
......@@ -653,7 +663,7 @@ public class DispatchSSLServerNIO implements Runnable {
final NioSslLogger nioLogger = null; // disabled logging
serverSocketChannel = new SSLServerSocketChannel(plainSocketChannel, sslContext, executor, nioLogger);
serverSocketChannel = new SSLServerSocketChannel(plainSocketChannel, sslContext, sslExecutor, nioLogger);
serverSocketChannel.needClientAuthentication = true;
try {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment