Skip to content

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

claude.dev 11 min read Case study mediumAdept

Using a "chaos loop" to harden the Claude Docs launch: 60 server errors across billions of requests

Before launching Claude Docs, a two-week "chaos loop" had Claude Code drive a production-mirroring staging cluster at over a million synthetic docs a day, inject failures (mass reconnects, killed servers, stalled databases, hot docs), read Datadog telemetry, and ship fixes, with a human approving only hard-to-undo changes like schema or storage layout. Writing the service in Rust with minimal, vendored dependencies kept memory attributable to its own code. That let Claude trace a 3 GB doc to per-keystroke copies and switch to copy-on-write, cutting it to 180 MB and projected capacity from 500+ pods to about 50. The launch saw 60 server errors across 2 billion requests, 4.6M docs in six days, and no rollbacks, at roughly $125K of inference; a smaller-service version is estimated at $3K–$10K.

Related posts

  • Continuous Load Testing

    Slack Engineering mediumAdept

    Slack moved to running its Koi Pond load-testing clients continuously, 24/7, against an organization 4x the size of its largest customer. Performance regressions get caught on every deploy without the cost of spinning up test environments. Making this safe required an Automatic Shutdown service that polls Prometheus via Trickster and stops tests when thresholds are breached (e.g. API success below 95% for five minutes), partial shutdown and Emergency Stop controls, DynamoDB-backed persistence so the Keeper survives pod restarts, and automated token generation via cron, job queues, exponential-backoff retries and encrypted S3 storage. A gradual rollout from 5,000 to 500,000 clients with cross-team communication produced zero off-hours pages in six months, and an ad-hoc test that once took a day of effort now takes minutes.

  • Rapidly scaling online storage to serve over 1 billion ChatGPT users

    OpenAI mediumAdept

    Habitat, OpenAI's online storage platform, grew from a client-side Python library over Azure Cosmos DB into a centralized Python service handling 70M+ requests per second and 500+ PB across about 40 regions. It moved to a service because coordinating client-library rollouts across dozens of services had become slow and error-prone. Running Python at this scale meant fighting tail latency from asyncio event-loop scheduling delay, which the team measured directly and controlled by keeping per-process concurrency low and scaling out worker processes. Specific fixes included shrinking and jittering Statsig feature-flag config refreshes, and switching aiohttp's LIFO connection reuse to FIFO to break a metastable failure that concentrated load on already-slow processes.

  • Corrosion

    Fly.io mediumAdept

    Corrosion is Fly.io's open-source service discovery system: a Rust program that propagates a SQLite database across thousands of workers via SWIM gossip and QUIC, using the cr-sqlite CRDT extension with last-write-wins logical timestamps instead of distributed consensus. It works because Fly's orchestration makes individual workers the source of truth for their own state, so updates rarely conflict, much like a link-state routing protocol such as OSPF. The war stories cover a Rust RwLock deadlock gossiped to every proxy that caused a fleet-wide outage, a nullable-column migration that triggered a cr-sqlite backfill storm, and Consul certificate expiry that drove Corrosion writes until uplinks saturated. The fixes are Tokio event-loop watchdogs, Antithesis testing, checkpoint backups for cluster rebuilds, republishing full Machine state instead of partial updates, and regionalized two-level clusters to shrink the blast radius.

  • Scaling Managed Agents with stable interfaces

    Anthropic Engineering mediumAdept

    Claude Managed Agents splits a long-running agent into three virtualized interfaces: an append-only session log, a stateless harness that calls Claude and routes tool calls, and sandboxes reached through a generic `execute(name, input) → string` tool call. Moving off a single coupled container turned sandboxes and harnesses into replaceable cattle. A crashed harness resumes from the durable log via `wake(sessionId)`, and credentials sit in vaults or MCP proxies the sandbox can't reach, which blocks prompt-injection token theft. The session also serves as a queryable context store outside Claude's context window. Provisioning containers lazily, only when a tool needs one, cut p50 time-to-first-token by about 60% and p95 by over 90%.

  • Failure is inevitable: Learning from a large outage, and building for reliability in depth at Datadog

    Datadog Engineering mediumAdept

    A March 2023 unsupervised global update knocked out connectivity to 50–60% of Datadog's Kubernetes nodes, yet the platform appeared fully down because services were designed to stop rather than show partial data. Instead of only fixing the trigger, Datadog rebuilt for graceful degradation. Changes include persisting data at intake before acknowledging receipt, letting pipelines skip backlogs to serve live data first, retries with backoff and earlier dead-letter queues, Kubernetes PriorityClass and faster autoscaling, removing a shared Cassandra tag cache from the critical path, cluster-local Vault instances, break-glass paths around circular recovery dependencies, and automated chaos testing. The general lessons are to persist early, prioritize real-time data, avoid global control systems, and scrutinize retries and caches.

The quest for software engineering knowledge.

Look:
Layout: