Skip to content

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

ClickHouse 6 min read Case study mediumAdept

How LY Corporation uses ClickHouse to observe one of the largest Kafka deployments on earth

LY Corporation (LINE + Yahoo! Japan) runs a Kafka platform of 200+ brokers serving 25,000+ clients and handling 31M messages/sec at peak, over 1 trillion messages and 2.6 PB of I/O per day. Its observability stack spans end-to-end latency probes, Async Profiler, eBPF and kernel delay accounting, and disk SMART data. The key layer is a Kafka API request log pipeline: requests are intercepted, serialized with Protocol Buffers, sent through an internal Kafka cluster and batch-ingested into ClickHouse at 7M rows/sec, about 4.1 trillion rows on 24 nodes. SQL queries over these logs confirmed a race condition between Produce and ListOffsets that caused non-monotonic offsets and halted replication, which led to an upstream patch.

Related posts

  • Scaling our Observability platform beyond 100 Petabytes by embracing wide events and replacing OTel

    ClickHouse mediumAdept

    ClickHouse's internal LogHouse platform grew from 19 PiB to over 100 PB of uncompressed logs (about 500 trillion rows), mostly by replacing the OpenTelemetry pipeline for ClickHouse server telemetry with SysEx. SysEx is a pull-based Go exporter that copies system tables byte-for-byte from customer pods into LogHouse in ClickHouse's Native format. It assigns pods to scrapers with a hash ring and queries a sliding time window trailing real time by about five minutes, so internal buffers flush before rows are read. Schema drift is handled with hashed, versioned tables unified through the Merge engine. The OTel collectors needed 800+ cores for 2M logs/s and still dropped events, while SysEx ships 37M logs/s on about 70 cores with no edge loss. HyperDX now replaces the team's Grafana-based UI.

  • Networking is a black box, we used eBPF to open it

    Railway mediumAdept

    Railway's Network Flows feature uses eBPF hooks on container packet ingress and egress to show real-time traffic between services as pipes on the project canvas, with click-through access to flow logs and kernel drop codes. Raw socket buffers are enriched with ports, addresses, cgroup-to-service and peer-service lookups, batched at 10,000 flows, and written to ClickHouse at roughly a million rows per second. The first design had about a thousand hosts writing directly to ClickHouse, and ReplacingMergeTree merge overhead degraded the cluster. An intermediate ingestion service that cut the writers to three and made inserts far larger fixed it. The feature was motivated by support tickets blaming the platform network for what were almost always application misconfigurations.

  • 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.

  • Why OpenAI chose ClickHouse for petabyte-scale observability

    ClickHouse mediumAdept

    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.

  • Monitor SLAs and scale ClickHouse Cloud with clickhousectl and agents

    ClickHouse mediumAdept

    Tagging frontend queries with `log_comment` lets you compute a specific latency SLA, such as p99 under 200 ms, directly from `system.query_log` across replicas. You can then diagnose a breach by comparing query volume against latency and checking Prometheus CPU, memory and concurrency metrics. High concurrency points to adding replicas, while memory pressure points to bigger replicas. `clickhousectl` handles the scaling, either from a simple cron that scales out on breach or by handing the breach to a Claude agent prompted to investigate and apply exactly one scaling action. Every action is recorded in the activity log for auditing.

The quest for software engineering knowledge.

Look:
Layout: