Skip to content

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

ClickHouse 32 min read Incident hardMaster

The case of the vanishing CPU: A Linux kernel debugging story

Intermittent, indefinite CPU saturation of ClickHouse Cloud pods, seen only on GCP, turned out to be a Linux kernel memory-management livelock. Pods sat just under their cgroup memory limit while every CPU spun in shrink_lruvec during memcg reclaim triggered by page-cache readahead on page faults. The investigation used gdb backtraces, bpftrace syscall latency histograms, perf top/stat, pidstat and an on-call runbook to reach a reproducible test case and a kernel fix, after which another kernel bug surfaced. One lesson along the way: signal-based user-space stack traces hide kernel time entirely, so gdb backtraces pointed the team at the wrong code.

Related posts

  • Debugging Systems in the Cloud: MySQL, Kubernetes, and Cgroups

    Shopify Engineering hardMaster

    Slow MySQL Pod startup and degraded query performance on long-running GKE nodes in Shopify's KateSQL platform traced back to a Linux kernel memory cgroup leak: roughly 50K zombie memory cgroups made mem_cgroup_commit_charge slow, so each 128MB mmap during InnoDB buffer pool initialization took about 100 ms. The investigation used strace, perf flamegraphs, slabtop and /proc/cgroups, and Google kernel engineers confirmed it as a side effect of slab reparenting on cgroup removal. Forcing kubepods memory.force_empty cut cgroups to about 1800, and an 80G buffer pool then initialized in five seconds. The permanent fix was upgrading to GKE 1.18 (COS 85, kernel 5.4). Interim options included recycling nodes, dropping caches and isolating short-lived Pods.

  • Not Everything Is Google’s Fault (Just Most Things)

    Railway mediumAdept

    A subset of Railway's GCP us-west machines softlocked and failed to fail over automatically, causing rolling ~10-minute per-host outages until manual failover and reduced resource pressure stabilized them. Serial console logs showed soft-locked CPU cores with stack traces in kvm_wait and __pv_queued_spin_lock_slowpath, which Railway links to a suspected bug in paravirtualized memory management on GCP guests that triggers under resource pressure even at ~50% of posted limits. The write-up also lists earlier GCP problems (networking blips, an arbitrary Artifact Registry quota cut, unresponsive support) that led Railway to build its own WireGuard/eBPF network and registry and to plan a move to bare metal in 2024.

  • How recurring network maintenance exposed 6 bugs

    Jane Street Tech Blog hardMaster

    Recurring weekend network partitions caused Jane Street's Kafka relays and consumer-group monitors to segfault, leak hundreds of thousands of sockets, and crash under recovery-time TCP connection surges, and tracing them uncovered six layered bugs. Among them are an eleven-year-old glibc bug where a failed res_init leaves nscount nonzero with null nameserver pointers so the next gethostbyname segfaults in sock_eq, a UDP socket leak when bind fails with EADDRINUSE under ephemeral-port exhaustion, and a fourteen-year-old Async regression where Tcp.connect_sock's timeout no longer covers DNS resolution. The rest are a Kafka client retry loop that never aborts timed-out attempts, duplicated concurrent discovery lookups, and a job runner migration that cut file-descriptor limits eightfold. Each bug masked the next, and the glibc fix shipped upstream in 2.44.

  • Core dump epidemiology: fixing an 18-year-old bug

    OpenAI hardMaster

    Mysterious return-to-bogus-address crashes in Rockset's C++ execution layer turned out to be two unrelated bugs: silent register corruption on a single bad Azure host, and an 18-year-old race in GNU libunwind's _Ux86_64_setcontext, which read the synthesized ucontext_t after moving %rsp past it, letting a frequent SIGUSR2 CPU-time signal clobber it during exception unwinding. The breakthrough came from switching from close inspection of individual cores to population analysis: an automated pipeline classified every production core dump from the past year, and the clean data set separated the two crash clusters by region, start date and node age. Fixes included denylisting the host, logging register state in the fatal signal handler, reusing VMs to make bad-node detection easier, and patching libunwind.

  • Incident Report: Dec 1st, 2023

    Railway mediumAdept

    A misconfigured new metrics collection agent sampled every process on each host at high frequency, driving heavy kernel-to-userspace memory transfers. Those transfers triggered cascading CPU soft locks on 30% of Railway's US-West fleet even though resource usage stayed within thresholds, and the team suspects an acknowledged Google Cloud hypervisor bug. Hosts failed randomly and in bursts, so the agent was not suspected at first. Recovery needed manual restarts confirmed via serial console logs, taking 10–30 minutes per host, and workloads were down for 10 minutes to 1 hour with no data loss. Follow-ups include mandatory staged rollouts (10/25/50/100%) for all services, faster deployment feedback, and moving toward bare metal to gain visibility into the full stack.

The quest for software engineering knowledge.

Look:
Layout: