perf: disable query/memory profiling for non prewarm queries

This commit is contained in:
Azat Khuzhin 2021-10-27 23:11:38 +03:00
parent 190459db33
commit 7957079f95
2 changed files with 12 additions and 2 deletions

View File

@ -24,6 +24,13 @@
<!-- Don't fail some prewarm queries too early -->
<timeout_before_checking_execution_speed>60</timeout_before_checking_execution_speed>
<!-- Query profiler enabled only for prewarm queries explicitly (see perf.py)
This is needed for flamegraphs. -->
<query_profiler_real_time_period_ns>0</query_profiler_real_time_period_ns>
<query_profiler_cpu_time_period_ns>0</query_profiler_cpu_time_period_ns>
<!-- Disable memory profiler too, since due to max_untracked_memory some queries may add trace entry and some may not -->
<memory_profiler_step>0</memory_profiler_step>
</default>
</profiles>
<users>

View File

@ -283,8 +283,11 @@ for query_index in queries_to_run:
# test coverage. We disable profiler for normal runs because
# it makes the results unstable.
res = c.execute(q, query_id = prewarm_id,
settings = {'max_execution_time': args.max_query_seconds,
'query_profiler_real_time_period_ns': 10000000})
settings = {
'max_execution_time': args.max_query_seconds,
'query_profiler_real_time_period_ns': 10000000,
'memory_profiler_step': '4Mi',
})
except clickhouse_driver.errors.Error as e:
# Add query id to the exception to make debugging easier.
e.args = (prewarm_id, *e.args)