Skip to content

Commit 36584ce

Browse files
authored
[To dev/1.3] Changed the default MQTT handler size to 1/2 number of processors & Fixed some default parameters when core number is 1 (#16363) (#16365)
* fix * fix
1 parent 52041d0 commit 36584ce

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎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
@@ -109,7 +109,7 @@ public class IoTDBConfig {
109109
private int mqttPort = 1883;
110110

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

114114
/** The mqtt message payload formatter. */
115115
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
@@ -586,7 +586,7 @@ public void loadProperties(TrimProperties properties) throws BadNodeUrlException
586586
"degree_of_query_parallelism", Integer.toString(conf.getDegreeOfParallelism()))));
587587

588588
if (conf.getDegreeOfParallelism() <= 0) {
589-
conf.setDegreeOfParallelism(Runtime.getRuntime().availableProcessors() / 2);
589+
conf.setDegreeOfParallelism(Math.max(1, Runtime.getRuntime().availableProcessors() / 2));
590590
}
591591

592592
conf.setMergeThresholdOfExplainAnalyze(
@@ -2730,7 +2730,7 @@ private void loadCQProps(TrimProperties properties) {
27302730
"continuous_query_thread_num",
27312731
Integer.toString(conf.getContinuousQueryThreadNum()))));
27322732
if (conf.getContinuousQueryThreadNum() <= 0) {
2733-
conf.setContinuousQueryThreadNum(Runtime.getRuntime().availableProcessors() / 2);
2733+
conf.setContinuousQueryThreadNum(Math.max(1, Runtime.getRuntime().availableProcessors() / 2));
27342734
}
27352735

27362736
conf.setContinuousQueryMinimumEveryInterval(

0 commit comments

Comments
 (0)