File tree Expand file tree Collapse file tree
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf Expand file tree Collapse file tree Original file line number Diff line number Diff 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" ;
Original file line number Diff line number Diff 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 (
You can’t perform that action at this time.
0 commit comments