Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ public class IoTDBConfig {

private long loadActiveListeningCheckIntervalSeconds = 5L;

private int loadActiveListeningMaxThreadNum = 8;
private int loadActiveListeningMaxThreadNum = Runtime.getRuntime().availableProcessors();

/** Pipe related */
/** initialized as empty, updated based on the latest `systemDir` during querying */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2357,19 +2357,15 @@ private void loadLoadTsFileProps(Properties properties) {
? conf.getLoadActiveListeningCheckIntervalSeconds()
: loadActiveListeningCheckIntervalSeconds);

final int defaultLoadActiveListeningMaxThreadNum =
Math.min(
conf.getLoadActiveListeningMaxThreadNum(),
Math.max(1, Runtime.getRuntime().availableProcessors() / 2));
final int loadActiveListeningMaxThreadNum =
conf.setLoadActiveListeningMaxThreadNum(
Integer.parseInt(
properties.getProperty(
"load_active_listening_max_thread_num",
Integer.toString(defaultLoadActiveListeningMaxThreadNum)));
conf.setLoadActiveListeningMaxThreadNum(
loadActiveListeningMaxThreadNum <= 0
? defaultLoadActiveListeningMaxThreadNum
: loadActiveListeningMaxThreadNum);
Integer.toString(conf.getLoadActiveListeningMaxThreadNum()))));

if (conf.getLoadActiveListeningMaxThreadNum() <= 0) {
conf.setLoadActiveListeningMaxThreadNum(Runtime.getRuntime().availableProcessors());
}
}

private void loadLoadTsFileHotModifiedProp(Properties properties) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1949,10 +1949,10 @@ load_active_listening_dirs=ext/load/pending
load_active_listening_fail_dir=ext/load/failed

# The maximum number of threads that can be used to load tsfile actively.
# The default value, when this parameter is commented out, is the minimum of 8 or the number of CPU cores.
# The default value, when this parameter is commented out or <= 0, use CPU core number.
# effectiveMode: restart
# Datatype: int
load_active_listening_max_thread_num=8
load_active_listening_max_thread_num=0

# The interval specified in seconds for the active listening mode to check the directory specified in load_active_listening_dirs.
# The active listening mode will check the directory every load_active_listening_check_interval_seconds seconds.
Expand Down