mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 02:21:59 +00:00
Fix
This commit is contained in:
parent
b7b269b140
commit
37cd91c0bf
@ -14,7 +14,7 @@ class ASTStorage;
|
||||
M(Milliseconds, poll_timeout_ms, 0, "Timeout for single poll from StorageFileLog.", 0) \
|
||||
M(UInt64, poll_max_batch_size, 0, "Maximum amount of messages to be polled in a single StorageFileLog poll.", 0) \
|
||||
M(UInt64, max_block_size, 0, "Number of row collected by poll(s) for flushing data from StorageFileLog.", 0) \
|
||||
M(UInt64, max_threads, 8, "Number of max threads to parse files, default is 8", 0) \
|
||||
M(UInt64, max_threads, 0, "Number of max threads to parse files, default is 0, which means the number will be max(1, physical_cpu_cores / 4)", 0) \
|
||||
M(Milliseconds, poll_directory_watch_events_backoff_init, 500, "The initial sleep value for watch directory thread.", 0) \
|
||||
M(Milliseconds, poll_directory_watch_events_backoff_max, 32000, "The max sleep value for watch directory thread.", 0) \
|
||||
M(UInt64, poll_directory_watch_events_backoff_factor, 2, "The speed of backoff, exponential by default", 0)
|
||||
|
@ -750,7 +750,11 @@ void registerStorageFileLog(StorageFactory & factory)
|
||||
auto physical_cpu_cores = getNumberOfPhysicalCPUCores();
|
||||
auto num_threads = filelog_settings->max_threads.value;
|
||||
|
||||
if (num_threads > physical_cpu_cores)
|
||||
if (!num_threads) /// Default
|
||||
{
|
||||
num_threads = std::max(unsigned(1), physical_cpu_cores / 4);
|
||||
}
|
||||
else if (num_threads > physical_cpu_cores)
|
||||
{
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Number of threads to parse files can not be bigger than {}", physical_cpu_cores);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user