Skip to content

Added clickhouse-benchmark --precise for better per-interval statistics#86684

Merged
serxa merged 13 commits intomasterfrom
benchmark-precise-mode
Sep 17, 2025
Merged

Added clickhouse-benchmark --precise for better per-interval statistics#86684
serxa merged 13 commits intomasterfrom
benchmark-precise-mode

Conversation

@serxa
Copy link
Copy Markdown
Member

@serxa serxa commented Sep 4, 2025

clickhouse-benchmark reports QPS for every interval set by --delay SECONDS option. Reported QPS values are unreliable when the number of queries per interval is not very high and queries intersect interval boundaries. This PR adds logic to mitigate this drawback by collecting stats simultaneously for multiple intervals. If the query starts in one interval and finishes in another, then such a query is accounted in all intervals with appropriate weights (see the long comment in code).

Here is the example of a run (look at the QPS per interval)
Before: https://pastila.nl/?001e41ad/a96000574de1c429d9b3f4a9bcf8ac6c#kH/s+G/CeG6NvBsE6jhZ2Q==
After: https://pastila.nl/?000b5e9f/ccb920d4efd26ec473e7adc3371b3a8f#WFxDE3I45j742SgV9hCYhA==

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

You can use clickhouse-benchmark --precise flag for more precise reporting of QPS and other per-interval metrics. It helps to get consistent QPS in case if durations of queries are comparable to the reporting interval --delay D

@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Sep 4, 2025

Workflow [PR], commit [b0e3c43]

Summary:

@clickhouse-gh clickhouse-gh bot added the pr-improvement Pull request with some product improvements label Sep 4, 2025
@bharatnc bharatnc self-assigned this Sep 4, 2025
Co-authored-by: Bharat Nallan <bharat@clickhouse.com>
serxa and others added 2 commits September 8, 2025 09:07
Co-authored-by: Bharat Nallan <bharat@clickhouse.com>
Co-authored-by: Bharat Nallan <bharat@clickhouse.com>
@serxa
Copy link
Copy Markdown
Member Author

serxa commented Sep 9, 2025

The failed test 01954_clickhouse_benchmark_multiple_long is related. It seems that I broke --roundrobin option. UPD. Fixed

@serxa serxa added this pull request to the merge queue Sep 17, 2025
Merged via the queue into master with commit 640775e Sep 17, 2025
123 checks passed
@serxa serxa deleted the benchmark-precise-mode branch September 17, 2025 09:48
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-improvement Pull request with some product improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants