---
title: "Testing the Performance of ClickHouse"
description: "ClickHouse catches performance regressions in CI by running the reference and patched servers side by side on the same machine and alternating about 3000 end-to-end test queries between them."
url: "https://swe.quest/articles/testing-the-performance-of-clickhouse-9f67306f19e976df"
canonical: "https://clickhouse.com/blog/testing-the-performance-of-click-house"
source: "ClickHouse"
published: "2021-08-19"
difficulty: "medium"
kind: "Case study"
reading_minutes: 11
tags: ["performance","testing","ci-cd","analytics"]
---

# Testing the Performance of ClickHouse

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2021-08-19, 11 min read, Case study. Original: [https://clickhouse.com/blog/testing-the-performance-of-click-house](https://clickhouse.com/blog/testing-the-performance-of-click-house)

## Summary

ClickHouse catches performance regressions in CI by running the reference and patched servers side by side on the same machine and alternating about 3000 end-to-end test queries between them. This cancels out environmental systematic errors. A non-parametric bootstrap on the difference of median run times yields a noise threshold T, and a change is flagged only when it exceeds both T and 5%. Queries with T of 10% or more are marked unstable. Regressions are investigated with the built-in sampling profiler (system.trace\_log), differential flamegraphs, ProfileEvents and hardware counters, while historical results stored in ClickHouse help locate when a change was introduced. Keeping false positives low matters more than producing a green check, and many test queries turned out to measure nothing meaningful.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Testing](https://swe.quest/tags/testing.md) (Engineering practices)
- [CI/CD](https://swe.quest/tags/ci-cd.md) (Reliability & operations)
- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)

## Prerequisites

- basic statistics
- profiling and flamegraphs ([easy posts on Performance engineering](https://swe.quest/tags/performance.md?difficulty=easy))
- SQL ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))

## Keywords

ClickHouse, clickhouse-local, perf, flamegraph, bootstrap, system.trace\_log, perf\_event\_open

## Related posts

- [How well is ClickHouse tested? A detailed view of increasing our own coverage](https://swe.quest/articles/how-well-is-clickhouse-tested-a-detailed-view-of-increasing-our-own-coverage-cfaf966583bc47db.md): ClickHouse · 2026-11-25 · Medium · 17 min read · Testing, CI/CD, C & C++, Compilers, AI for coding
  ClickHouse's ~2.6M-line C++ codebase reaches 91.8% line, 81.0% branch and 91.8% function coverage, measured with Clang source-based coverage across 23 CI shards every 3 hours and published at coverage.clickhouse.com.
- [ClickHouse Over the Years with Benchmarks](https://swe.quest/articles/clickhouse-over-the-years-with-benchmarks-4ccceaaaa0dadc4e.md): ClickHouse · 2022-06-14 · Medium · 17 min read · Analytics & OLAP, Performance engineering, Databases
  Every ClickHouse release from 1.1.54378 (April 2018) onward was installed on one AWS m5.8xlarge and run through the Star Schema Benchmark, the Brown University benchmark and ClickHouse's own hits benchmark to see how performance changed over time.
- [Building ClickCannon - a tool for benchmarking ClickHouse](https://swe.quest/articles/building-clickcannon-a-tool-for-benchmarking-clickhouse-15503a1f117264f6.md): ClickHouse · 2026-06-11 · Medium · 16 min read · Performance engineering, Go, Analytics & OLAP, Observability, Concurrency
  ClickCannon is an open-source Go tool for benchmarking ClickHouse insert and query workloads, built to produce hardware sizing recommendations for ClickStack observability deployments.
- [Decorating a Christmas Tree With the Help Of Flaky Tests](https://swe.quest/articles/decorating-a-christmas-tree-with-the-help-of-flaky-tests-286b59f771e1aae7.md): ClickHouse · 2021-12-27 · Medium · 3 min read · Testing, CI/CD, Concurrency
  ClickHouse treats flaky tests as bugs to investigate rather than noise to mute or retry, and deliberately makes tests flakier to surface hidden issues.
- [Fuzzing ClickHouse](https://swe.quest/articles/fuzzing-clickhouse-2e19ad8301dd21c4.md): ClickHouse · 2021-03-11 · Medium · 8 min read · Testing, Databases, Vulnerability research, CI/CD
  ClickHouse's AST-based query fuzzer takes SQL queries from the regression test suite, parses them, and randomly mutates the AST.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
