Skip to content

Commit c3d0a2f

Browse files
authored
Merge pull request ClickHouse#79964 from Algunenano/disable_cpu_overload
Disable connections and queries drop by default
2 parents 79c795f + f81be24 commit c3d0a2f

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/Common/ProfileEvents.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,8 @@ Event end() { return END; }
11351135

11361136
bool checkCPUOverload(Int64 os_cpu_busy_time_threshold, double min_ratio, double max_ratio, bool should_throw)
11371137
{
1138+
if ((max_ratio <= 0.0) || (max_ratio <= min_ratio))
1139+
return false;
11381140
double cpu_load = global_counters.getCPUOverload(os_cpu_busy_time_threshold);
11391141

11401142
if (cpu_load > DBL_EPSILON)

src/Core/Settings.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6510,8 +6510,8 @@ File/S3 engines/table function will parse paths with '::' as `<archive> :: <file
65106510
DECLARE(Milliseconds, low_priority_query_wait_time_ms, 1000, R"(
65116511
When the query prioritization mechanism is employed (see setting `priority`), low-priority queries wait for higher-priority queries to finish. This setting specifies the duration of waiting.
65126512
)", BETA) \
6513-
DECLARE(Float, min_os_cpu_wait_time_ratio_to_throw, 2.0, "Min ratio between OS CPU wait (OSCPUWaitMicroseconds metric) and busy (OSCPUVirtualTimeMicroseconds metric) times to consider rejecting queries. Linear interpolation between min and max ratio is used to calculate the probability, the probability is 0 at this point.", 0) \
6514-
DECLARE(Float, max_os_cpu_wait_time_ratio_to_throw, 6.0, "Max ratio between OS CPU wait (OSCPUWaitMicroseconds metric) and busy (OSCPUVirtualTimeMicroseconds metric) times to consider rejecting queries. Linear interpolation between min and max ratio is used to calculate the probability, the probability is 1 at this point.", 0) \
6513+
DECLARE(Float, min_os_cpu_wait_time_ratio_to_throw, 0.0, "Min ratio between OS CPU wait (OSCPUWaitMicroseconds metric) and busy (OSCPUVirtualTimeMicroseconds metric) times to consider rejecting queries. Linear interpolation between min and max ratio is used to calculate the probability, the probability is 0 at this point.", 0) \
6514+
DECLARE(Float, max_os_cpu_wait_time_ratio_to_throw, 0.0, "Max ratio between OS CPU wait (OSCPUWaitMicroseconds metric) and busy (OSCPUVirtualTimeMicroseconds metric) times to consider rejecting queries. Linear interpolation between min and max ratio is used to calculate the probability, the probability is 1 at this point.", 0) \
65156515
\
65166516
/* ####################################################### */ \
65176517
/* ########### START OF EXPERIMENTAL FEATURES ############ */ \

src/Core/SettingsChangesHistory.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ const VersionToSettingsChangesMap & getSettingsChangesHistory()
7878
{"page_cache_lookahead_blocks", 16, 16, "Made this setting adjustable on a per-query level."},
7979
{"output_format_pretty_glue_chunks", "0", "auto", "A new setting to make Pretty formats prettier."},
8080
{"parallel_hash_join_threshold", 0, 100'000, "New setting"},
81+
{"min_os_cpu_wait_time_ratio_to_throw", 0, 0, "Setting values were changed and backported to 25.4"},
82+
{"max_os_cpu_wait_time_ratio_to_throw", 0, 0, "Setting values were changed and backported to 25.4"},
8183
{"make_distributed_plan", 0, 0, "New experimental setting."},
8284
{"execute_distributed_plan_locally", 0, 0, "New experimental setting."},
8385
{"default_shuffle_join_bucket_count", 8, 8, "New experimental setting."},
@@ -105,8 +107,8 @@ const VersionToSettingsChangesMap & getSettingsChangesHistory()
105107
{"cast_string_to_variant_use_inference", true, true, "New setting to enable/disable types inference during CAST from String to Variant"},
106108
{"distributed_cache_read_request_max_tries", 20, 20, "New setting"},
107109
{"query_condition_cache_store_conditions_as_plaintext", false, false, "New setting"},
108-
{"min_os_cpu_wait_time_ratio_to_throw", 0, 2, "New setting"},
109-
{"max_os_cpu_wait_time_ratio_to_throw", 0, 6, "New setting"},
110+
{"min_os_cpu_wait_time_ratio_to_throw", 0, 0, "New setting"},
111+
{"max_os_cpu_wait_time_ratio_to_throw", 0, 0, "New setting"},
110112
{"query_plan_merge_filter_into_join_condition", false, true, "Added new setting to merge filter into join condition"},
111113
{"use_local_cache_for_remote_storage", true, false, "Obsolete setting."},
112114
{"iceberg_timestamp_ms", 0, 0, "New setting."},

0 commit comments

Comments
 (0)