Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

ClickHouse 6 min read Case study mediumAdept

Why OpenAI chose ClickHouse for petabyte-scale observability

OpenAI ingests petabytes of logs daily, growing over 20% monthly, into a ClickHouse cluster of 90 shards with two replicas each, fed by Fluent Bit agents. Recent data stays on local disk because about 80% of queries touch the last two days, and older logs tier to blob storage. ClickHouse was chosen for being open source, horizontally scalable, tunable in its indexing and queryable in SQL. When the GPT-4o image generation launch raised log volume 50% overnight, the team added a query-only replica and sampled logs, then profiled ClickHouse and found more than half of CPU time going to Bloom filter construction. Replacing a per-insert division with a multiply and bit shift cut CPU usage 40%, and the fix was upstreamed.

Assumes: columnar databasesBloom filterslog ingestion pipelines

Related posts

  • How we made ClickStack 5x faster for ClickHouse observability

    ClickHouse hardMaster

    ClickStack's OpenTelemetry logs schema, inherited from the ClickHouse exporter for the OTel Collector, was reworked through a benchmark-driven process. The changes combined time-bucketed primary key redesign, text indexes, query rewrites, materialized views and newer ClickHouse features, cutting representative observability query latency by more than 5×. Every schema iteration was validated with the ClickCannon tool and ephemeral ClickHouse Cloud instances at 640 MiB/s ingest on three 24-core replicas. Each change was judged against ingestion throughput, CPU, memory, part counts and the full query workload, so a gain on one query pattern could not hide regressions elsewhere.

  • How Canva achieved 10x faster search and 70% lower costs with ClickHouse

    ClickHouse mediumAdept

    Canva moved tracing and logging (about 3 million spans and 3 million logs per second) onto a self-managed ClickHouse cluster of 5 shards × 3 replicas on Kubernetes. It reached a 14x compression ratio, cut costs by about 70%, and brought P90 trace search down from 30s to 2.5s. The ingestion gains came from batching roughly 200k spans per insert in OpenTelemetry collectors and writing straight to local tables. Search speed came from a sorting key aligned with Jaeger's filters, daily partitions, a materialized-view lookup table keyed by trace ID, and a client-side sliding search window. Logs flow through Kinesis and Lambda using tuned async inserts, with ngram Bloom filters on flattened log strings for free-text search and a custom DSL query gateway.

  • Clever ingests 200x more logs at the same cost with ClickHouse Cloud

    ClickHouse mediumAdept

    Clever replaced a split Datadog/Athena logging setup with ClickHouse Cloud. It now indexes all ~150 TB/month of logs from 400 services and 200 Lambdas with 60-day retention, a 200x increase in searchable volume, at no extra cost and with 10x compression. The schema extracts hot fields into columns and stores the rest as raw JSON plus an attributes map. It uses token bloom filter indexes at granularity 32 for full-text search, date partitions with a 60-day TTL, and orders by negative Unix timestamp for an 8-10x query speedup. Resilience comes from separate dev and per-region prod services joined via remoteSecure and merge tables, all managed with Terraform and Goose. A custom LogQL-to-SQL layer keeps Grafana familiar for engineers.

  • Scaling observability at Character.AI: thousands of GPUs, 10x logs, and 50% lower cost with ClickStack

    ClickHouse mediumAdept

    Character.AI consolidated fragmented logging across multi-cloud Kubernetes GPU clusters onto ClickStack (HyperDX UI) backed by ClickHouse Cloud. It ingests 10x more log data at 50% lower cost, and log searches that took minutes now return in seconds. Raw output of about 450 PB/month is tamed with aggressive sampling: errors and warnings are kept in full, while info logs are sampled at 1 in 10,000 for the backbone service and 1% elsewhere. OpenTelemetry Collector DaemonSets insert directly with async inserts and batching. Schema tuning included primary keys aligned to time and service queries, materialized columns extracted from JSON, pruned skip indexes and per-column compression, yielding roughly 15–20x compression. Collector misconfiguration, such as missing batching or unsampled ingestion, caused outages, and a gateway layer plus native JSON and PromQL support are planned next.

  • Our New Observability Platform for 100B Logs

    Railway mediumAdept

    Railway rebuilt its logging backend on ClickHouse to power Log Explorer, handling about 1 billion new logs per day, 100 billion stored logs and 60 queries/sec at roughly 50ms average latency on a 2-shard/2-replica cluster. The previous system (local filesystem plus GCS, filtering in a single Go process) couldn't do cross-service search, fast far-back queries, horizontal scaling or aggregates. ClickHouse compressed 28TB of tagged logs to 5TB, and the team rolled it out within a week by dual-writing via Vector and translating their filter DSL to SQL. The main production surprise was asynchronous replication omitting recent logs, which an HAProxy primary-routing attempt didn't fix but the insert_distributed_sync setting did.

The quest for software engineering knowledge.

Look:
Layout: