Repository navigation
Stabilize four noisy performance test queries - #122458
Conversation
These queries were flagged as slower/faster/unstable on master runs, or scored as confirmed regressions by the performance dashboard on unrelated PRs, because the two compared servers did not measure the same work: - `and_compare_chain_derived`: both tables are created with `numbers_mt`, which writes a varying number of parts, and the measured runs stop merges, so the servers read different layouts (the join query took 34 ms over 17 parts and 82 ms over one part on the same binary). Merge each table to one part and check it. Query 2 now keeps 2M rows per side (`8000000 < l.v`) and runs at about 150 ms instead of 20 ms. - `set_index`: the IN set was built from `rand`, so every run looked up a different set, selected different ranges and read a different number of rows before `read_overflow_mode = 'break'`. Use a fixed pseudo-random sample (`toUInt32(cityHash64(number))`) and merge the 500M-row table to one part. - `formats_columns_nullable`: `SELECT * ... LIMIT 1000` read 6-10 ms, and parallel parsing parsed a varying amount ahead before the LIMIT cancelled it (`LIMIT 30000` of CSV took 197 ms with it and 38 ms without). Disable parallel parsing for that query and read 100000 rows, about 200 ms for text formats. - `serialization_pool_lookup`: the fixed `max_threads = 16` oversubscribed the 8 pinned cores of the amd runners; query 0 was flagged in 9.3% of amd master runs against 0.4% on arm. Use the harness default of one thread per pinned CPU. Master flag rates over 14 days (slower/faster/unstable share of master runs): `and_compare_chain_derived #2` 5-8%, `set_index #0` 14% (arm), `formats_columns_nullable #1` 19% (arm), `serialization_pool_lookup #0` 9% (amd).
|
Workflow [PR], commit [ab0976a] Summary: ✅
AI ReviewSummaryThis PR stabilizes four noisy performance benchmarks by fixing nondeterministic inputs, lengthening short queries, and forcing stable part layouts where the measured runs stop merges. I found one benchmark-contract issue in Findings
Final Verdict
|
| This measures the pool's hit path under contention. | ||
| --> | ||
| <!-- | ||
| `max_threads` is left at the harness default, which is one thread per CPU the servers are pinned to. |
There was a problem hiding this comment.
tests/performance/scripts/config/users.d/perf-comparison-tweaks-users.xml:19 hard-codes max_threads = 12, and ci/jobs/performance_tests.py:611-622 only rewrites that on x86_64. So removing the local <max_threads>16</max_threads> does not leave this benchmark at "one thread per CPU the servers are pinned to" on arm CI; it drops the arm workload from 16 threads to 12 too. If the intent is really "use one thread per pinned CPU", that has to be enforced in the perf harness/profile or with an architecture-specific override, otherwise this comment and the benchmark contract are wrong.
Since ClickHouse#122458 the first query of the test (#0-ClickHouse#7, one per format) is SELECT * ... LIMIT 100000 with input_format_parallel_parsing = 0, so the text formats are parsed in one thread. On ARM the speed of that parse is fixed per server process: the 7 runs of one server agree within 1-2%, while different servers take 0.26-0.55 s for ClickHouse#2 (JSONEachRow). In the failing job on ClickHouse#101022 (+54.9%, 0.338 -> 0.524 s) the confirmation restart drew new levels for both servers (0.293 and 0.345 s), and the slow side read the same rows and bytes with 1.58x the user CPU. ClickHouse#1 and ClickHouse#2 share the factor within a process (r = 0.86); it does not reach the other 80 queries of the same processes, which read the same files with parallel parsing. Why the single-threaded parse is per process on ARM is not established. Runs whose two servers differ by more than 15% (query_metric_runs_v1, raw samples, since 2026-09-27): arm PR arm master amd PR amd master #0 TSVWithNames 38/200 5/33 0/48 0/42 ClickHouse#1 CSVWithNames 111/191 19/35 0/42 0/30 ClickHouse#2 JSONEachRow 112/199 15/31 0/34 0/32 ClickHouse#3-ClickHouse#7 binary 1/982 0/188 0/180 0/185 The 80 parallel-parsing queries on the text formats: 0 of 7232 ARM runs. Read the whole file with the default parallel parsing instead: without a LIMIT the amount parsed does not depend on read-ahead (why ClickHouse#122458 disabled parallel parsing), and no text format is parsed in one thread. Avro has no parallel parsing, so ClickHouse#3 now takes about 2.7 s on ARM (report-only "too long"; ClickHouse#75 of this test is already 2.16 s). The text of #0-ClickHouse#7 changes, ClickHouse#8-ClickHouse#87 are unchanged. Local check on x86 with the official 26.10.1.1403 master build, server pinned to 16 cores with max_parsing_threads = 16, perf.py, 7 runs: new #0-ClickHouse#2 0.43, 0.47 and 0.96 s with 3% spread, ClickHouse#3 2.15 s, ClickHouse#4-ClickHouse#7 0.09-0.53 s; every query reads all 2000000 rows of the file, #0-ClickHouse#2 in 7-15 threads. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Related: #120927
Related: #122073
Four performance test queries were flagged on master runs of the same code, and were scored as confirmed regressions by the performance dashboard on unrelated PRs, because the two compared servers did not measure the same work. This makes the work identical on both servers, and moves two of the queries that ran in under 20 ms well above 100 ms.
set_index #0stays at about 40 ms: its work is now deterministic, and making it longer would change what it measures.and_compare_chain_derived #2numbers_mtwrites a varying number of parts and the measured runs stop merges, so the servers read different layouts (34 ms over 17 parts, 82 ms over one part, same binary); 20 ms querythrowIf; bound8000000 < l.vkeeps 2M rows per side, about 150 msset_index #0rand: every run looks up a different set and reads a different number of rows beforeread_overflow_mode = 'break'toUInt32(cityHash64(number)), merge the table to one partformats_columns_nullable #1(and the other formats of that template)LIMITcancels it (LIMIT 30000of CSV: 197 ms with it, 38 ms without)LIMIT 100000withinput_format_parallel_parsing = 0for that query only, about 200 ms for text formatsserialization_pool_lookup #0max_threads = 16oversubscribes the 8 cores the amd servers are pinned toThe edited tests pass through
perf.py --stop-mergeslocally on a master build.Found in a 24-hour sweep of PR perf failures (312 of about 2540 PR shards red, 246 of them without a single
slowerquery).Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Stabilize four noisy performance test queries.
Workflow [PR]
Sync PR [sync-upstream/pr/122458]
Version info
26.10.1.778-master(included in26.10and later)