mirror of https://github.com/apache/iotdb
Merge pull request #353 from yx-zhang/configMaxCon
add max concurrent client number
This commit is contained in:
commit
719e87eff2
|
@ -27,6 +27,8 @@ rpc_port=6667
|
|||
|
||||
rpc_thrift_compression_enable=false
|
||||
|
||||
rpc_max_concurrent_client_num=65535
|
||||
|
||||
####################
|
||||
### Dynamic Parameter Adapter Configuration
|
||||
####################
|
||||
|
|
|
@ -48,6 +48,11 @@ public class IoTDBConfig {
|
|||
*/
|
||||
private int rpcPort = 6667;
|
||||
|
||||
/**
|
||||
* Max concurrent client number
|
||||
*/
|
||||
private int maxConcurrentClientNum = 65535;
|
||||
|
||||
/**
|
||||
* Memory allocated for the read process
|
||||
*/
|
||||
|
@ -470,6 +475,14 @@ public class IoTDBConfig {
|
|||
this.enableStatMonitor = enableStatMonitor;
|
||||
}
|
||||
|
||||
public int getMaxConcurrentClientNum() {
|
||||
return maxConcurrentClientNum;
|
||||
}
|
||||
|
||||
public void setMaxConcurrentClientNum(int maxConcurrentClientNum) {
|
||||
this.maxConcurrentClientNum = maxConcurrentClientNum;
|
||||
}
|
||||
|
||||
public int getStatMonitorDetectFreqSec() {
|
||||
return statMonitorDetectFreqSec;
|
||||
}
|
||||
|
|
|
@ -241,6 +241,15 @@ public class IoTDBDescriptor {
|
|||
conf.setPerformanceStatMemoryInKB(Integer
|
||||
.parseInt(properties.getProperty("performance_stat_memory_in_kb",
|
||||
Integer.toString(conf.getPerformanceStatMemoryInKB())).trim()));
|
||||
|
||||
int maxConcurrentClientNum = Integer.parseInt(properties.
|
||||
getProperty("max_concurrent_client_num",
|
||||
Integer.toString(conf.getMaxConcurrentClientNum()).trim()));
|
||||
if (maxConcurrentClientNum <= 0) {
|
||||
maxConcurrentClientNum = 65535;
|
||||
}
|
||||
conf.setMaxConcurrentClientNum(maxConcurrentClientNum);
|
||||
|
||||
} catch (IOException e) {
|
||||
logger.warn("Cannot load config file because, use default configuration", e);
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -210,7 +210,8 @@ public class JDBCService implements JDBCServiceMBean, IService {
|
|||
IoTDBConfig config = IoTDBDescriptor.getInstance().getConfig();
|
||||
serverTransport = new TServerSocket(new InetSocketAddress(config.getRpcAddress(),
|
||||
config.getRpcPort()));
|
||||
poolArgs = new TThreadPoolServer.Args(serverTransport);
|
||||
poolArgs = new TThreadPoolServer.Args(serverTransport).maxWorkerThreads(IoTDBDescriptor.
|
||||
getInstance().getConfig().getMaxConcurrentClientNum()).minWorkerThreads(1);
|
||||
poolArgs.executorService = IoTDBThreadPoolFactory.createThriftRpcClientThreadPool(poolArgs,
|
||||
ThreadName.JDBC_CLIENT.getName());
|
||||
poolArgs.processor(processor);
|
||||
|
|
Loading…
Reference in New Issue