Skip to content

Commit

Permalink
optimize: get netty config property from system properties. (apache#3336
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jsbxyyx authored Dec 14, 2020
1 parent f5ee231 commit f6193e3
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions core/src/main/java/io/seata/core/rpc/netty/NettyServerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,24 @@
*/
public class NettyServerConfig extends NettyBaseConfig {

private int serverSelectorThreads = WORKER_THREAD_SIZE;
private int serverSocketSendBufSize = 153600;
private int serverSocketResvBufSize = 153600;
private int serverWorkerThreads = WORKER_THREAD_SIZE;
private int soBackLogSize = 1024;
private int writeBufferHighWaterMark = 67108864;
private int writeBufferLowWaterMark = 1048576;
private int serverSelectorThreads = Integer.parseInt(System.getProperty(
ConfigurationKeys.TRANSPORT_PREFIX + "serverSelectorThreads", String.valueOf(WORKER_THREAD_SIZE)));
private int serverSocketSendBufSize = Integer.parseInt(System.getProperty(
ConfigurationKeys.TRANSPORT_PREFIX + "serverSocketSendBufSize", String.valueOf(153600)));
private int serverSocketResvBufSize = Integer.parseInt(System.getProperty(
ConfigurationKeys.TRANSPORT_PREFIX + "serverSocketResvBufSize", String.valueOf(153600)));
private int serverWorkerThreads = Integer.parseInt(System.getProperty(
ConfigurationKeys.TRANSPORT_PREFIX + "serverWorkerThreads", String.valueOf(WORKER_THREAD_SIZE)));
private int soBackLogSize = Integer.parseInt(System.getProperty(
ConfigurationKeys.TRANSPORT_PREFIX + "soBackLogSize", String.valueOf(1024)));
private int writeBufferHighWaterMark = Integer.parseInt(System.getProperty(
ConfigurationKeys.TRANSPORT_PREFIX + "writeBufferHighWaterMark", String.valueOf(67108864)));
private int writeBufferLowWaterMark = Integer.parseInt(System.getProperty(
ConfigurationKeys.TRANSPORT_PREFIX + "writeBufferLowWaterMark", String.valueOf(1048576)));
private static final int DEFAULT_LISTEN_PORT = 8091;
private static final int RPC_REQUEST_TIMEOUT = 30 * 1000;
private int serverChannelMaxIdleTimeSeconds = 30;
private int serverChannelMaxIdleTimeSeconds = Integer.parseInt(System.getProperty(
ConfigurationKeys.TRANSPORT_PREFIX + "serverChannelMaxIdleTimeSeconds", String.valueOf(30)));
private static final String EPOLL_WORKER_THREAD_PREFIX = "NettyServerEPollWorker";

/**
Expand Down

0 comments on commit f6193e3

Please sign in to comment.