stress: tune memory_profiler_step too

This commit is contained in:
Azat Khuzhin 2021-12-03 21:27:40 +03:00
parent 169941c5d0
commit d3a7aed005

View File

@ -118,13 +118,13 @@ def prepare_for_hung_check(drop_databases):
# Here we try to drop all databases in async mode. If some queries really hung, than drop will hung too.
# Otherwise we will get rid of queries which wait for background pool. It can take a long time on slow builds (more than 900 seconds).
#
# Also specify max_untracked_memory to allow 100MiB of memory to overcommit.
databases = check_output('clickhouse client -q "SHOW DATABASES" --max_untracked_memory=100Mi',
# Also specify max_untracked_memory to allow 1GiB of memory to overcommit.
databases = check_output('clickhouse client -q "SHOW DATABASES" --max_untracked_memory=1Gi --memory_profiler_step=1Gi',
shell=True, timeout=30).decode('utf-8').strip().split()
for db in databases:
if db == "system":
continue
command = f'clickhouse client -q "DROP DATABASE {db}" --max_untracked_memory=100Mi'
command = f'clickhouse client -q "DROP DATABASE {db}" --max_untracked_memory=1Gi --memory_profiler_step=1Gi'
# we don't wait for drop
Popen(command, shell=True)
break
@ -192,9 +192,19 @@ if __name__ == "__main__":
have_long_running_queries = prepare_for_hung_check(args.drop_databases)
logging.info("Checking if some queries hung")
cmd = ' '.join([args.test_cmd,
# Do not track memory allocations up to 100MiB,
# Do not track memory allocations up to 1Gi,
# this will allow to ignore server memory limit (max_server_memory_usage) for this query.
"--client-option", "max_untracked_memory=100Mi",
#
# NOTE: memory_profiler_step should be also adjusted, because:
#
# untracked_memory_limit = min(settings.max_untracked_memory, settings.memory_profiler_step)
#
# NOTE: that if there will be queries with GROUP BY, this trick
# will not work due to CurrentMemoryTracker::check() from
# Aggregator code.
# But right now it should work, since neither hung check, nor 00001_select_1 has GROUP BY.
"--client-option", "max_untracked_memory=1Gi",
"--client-option", "memory_profiler_step=1Gi",
"--hung-check",
"00001_select_1"
])