Skip to content

Commit 5b08009

Browse files
authored
Changed the default MQTT handler size to 1/2 number of processors & Fixed some default parameters when core number is 1 (apache#16363)
* fix * fix
1 parent 31fa71e commit 5b08009

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public class IoTDBConfig {
112112
private int mqttPort = 1883;
113113

114114
/** The handler pool size for handing the mqtt messages. */
115-
private int mqttHandlerPoolSize = 1;
115+
private int mqttHandlerPoolSize = Math.max(1, Runtime.getRuntime().availableProcessors() >> 1);
116116

117117
/** The mqtt message payload formatter. */
118118
private String mqttPayloadFormatter = "json";

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ public void loadProperties(TrimProperties properties) throws BadNodeUrlException
528528
"degree_of_query_parallelism", Integer.toString(conf.getDegreeOfParallelism()))));
529529

530530
if (conf.getDegreeOfParallelism() <= 0) {
531-
conf.setDegreeOfParallelism(Runtime.getRuntime().availableProcessors() / 2);
531+
conf.setDegreeOfParallelism(Math.max(1, Runtime.getRuntime().availableProcessors() / 2));
532532
}
533533

534534
conf.setMergeThresholdOfExplainAnalyze(
@@ -2541,7 +2541,7 @@ private void loadCQProps(TrimProperties properties) {
25412541
"continuous_query_thread_num",
25422542
Integer.toString(conf.getContinuousQueryThreadNum()))));
25432543
if (conf.getContinuousQueryThreadNum() <= 0) {
2544-
conf.setContinuousQueryThreadNum(Runtime.getRuntime().availableProcessors() / 2);
2544+
conf.setContinuousQueryThreadNum(Math.max(1, Runtime.getRuntime().availableProcessors() / 2));
25452545
}
25462546

25472547
conf.setContinuousQueryMinimumEveryInterval(

0 commit comments

Comments
 (0)