This commit is contained in:
@@ -171,6 +171,7 @@ public final class Application {
|
|||||||
this.singletonrun = singletonrun;
|
this.singletonrun = singletonrun;
|
||||||
this.config = config;
|
this.config = config;
|
||||||
System.setProperty("redkale.version", Redkale.getDotedVersion());
|
System.setProperty("redkale.version", Redkale.getDotedVersion());
|
||||||
|
System.setProperty("sun.nio.ch.maxCompletionHandlersOnStack", String.valueOf(Runtime.getRuntime().availableProcessors() * 32));
|
||||||
|
|
||||||
final File root = new File(System.getProperty(RESNAME_APP_HOME));
|
final File root = new File(System.getProperty(RESNAME_APP_HOME));
|
||||||
this.resourceFactory.register(RESNAME_APP_TIME, long.class, this.startTime);
|
this.resourceFactory.register(RESNAME_APP_TIME, long.class, this.startTime);
|
||||||
@@ -388,7 +389,6 @@ public final class Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
System.setProperty("sun.nio.ch.internalThreadPoolSize", "" + Runtime.getRuntime().availableProcessors() * 4);
|
|
||||||
System.setProperty("java.util.concurrent.ForkJoinPool.common.parallelism", "" + Runtime.getRuntime().availableProcessors() * 4);
|
System.setProperty("java.util.concurrent.ForkJoinPool.common.parallelism", "" + Runtime.getRuntime().availableProcessors() * 4);
|
||||||
System.setProperty("net.transport.poolmaxconns", "100");
|
System.setProperty("net.transport.poolmaxconns", "100");
|
||||||
System.setProperty("net.transport.pinginterval", "30");
|
System.setProperty("net.transport.pinginterval", "30");
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ public class TcpAioProtocolServer extends ProtocolServer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void open(AnyValue config) throws IOException {
|
public void open(AnyValue config) throws IOException {
|
||||||
group = AsynchronousChannelGroup.withThreadPool(context.executor);
|
//group = AsynchronousChannelGroup.withThreadPool(context.executor);
|
||||||
|
group = AsynchronousChannelGroup.withFixedThreadPool(context.executor.getCorePoolSize(), context.executor.getThreadFactory());
|
||||||
this.serverChannel = AsynchronousServerSocketChannel.open(group);
|
this.serverChannel = AsynchronousServerSocketChannel.open(group);
|
||||||
|
|
||||||
final Set<SocketOption<?>> options = this.serverChannel.supportedOptions();
|
final Set<SocketOption<?>> options = this.serverChannel.supportedOptions();
|
||||||
|
|||||||
Reference in New Issue
Block a user