Logarithm: A logging engine for AI training workflows and services
Logarithm is Meta's internal serverless, multitenant log indexing service, written in C++20 with coroutines, that ingests over 100 GB/s of logs and serves thousands of queries per second with SLOs on freshness, completeness, durability and latency. Its architecture rests on a few choices: a disaggregated compute/storage split, with logs stored as ORC blocks in Manifold and lightweight Bloom-filter secondary indices cached on query clusters, plus tiering across memory, SSD and blob storage. Scribe/LogDevice queues and a sharded MySQL locality service handle durability and block placement, and Shard Manager drives ingestion elasticity. Queries can trade result completeness or ordering for latency, and a randomized streaming API lets AI training dashboards render hundreds of tensor time series incrementally. A per-line metadata API attaches context such as PyTorch rank IDs, which helps debug distributed training failures.
Related posts
- How We Rebuilt Our Log Storage and Search Infrastructure for Scale
Railway mediumAdeptRailway replaced per-request Docker log polling (every 2 seconds, straining the Docker daemon across 500,000+ deployments) with a centralized log pipeline. Docker's syslog driver forwards container logs to a per-node Vector agent, which ships them to a central Vector instance that writes hourly filesystem buckets for real-time tailing and short-term queries and batches them to Google Cloud Storage for long-term retention. A Go gRPC streaming service serves logs through GraphQL subscriptions to the React frontend, enabling historical deployment logs and keyword filtering, with Vector's Datadog sink used for pipeline monitoring.
- 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 mediumAdeptRailway 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.
- 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.
- A Quadrillion Rows across three Clouds: scaling LogHouse
ClickHouse mediumAdept
LogHouse, ClickHouse Cloud's internal logging platform, has grown to 431 PiB uncompressed (27 PiB on disk) and 1.59 quadrillion rows across 36 cells in 33 geoshards on three clouds, ingesting up to 80 GiB/s and 190M rows/s. Writes stay local to each region, with busy regions split into cells keyed by source Kubernetes cluster. Async Inserts cut part creation by 4–24x, and the largest tables moved from monthly to daily partitions once parts hit the max merge size. OTel collectors spill failed batches to S3 so that outages cause delay rather than data loss. On the read side, a three-level Distributed table hierarchy (global, regional, local SharedMergeTree) with region-named shards for pruning gives users one endpoint and sub-second cross-cloud queries.