---
title: "The case of the vanishing CPU: A Linux kernel debugging story"
description: "Intermittent, indefinite CPU saturation of ClickHouse Cloud pods, seen only on GCP, turned out to be a Linux kernel memory-management livelock."
url: "https://swe.quest/articles/the-case-of-the-vanishing-cpu-a-linux-kernel-debugging-story-3db1aa1b81ec8319"
canonical: "https://clickhouse.com/blog/a-case-of-the-vanishing-cpu-a-linux-kernel-debugging-story"
source: "ClickHouse"
published: "2025-03-05"
difficulty: "hard"
kind: "Incident"
reading_minutes: 32
tags: ["linux","memory-management","debugging","performance","incident-response"]
---

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

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2025-03-05, 32 min read, Incident. Original: [https://clickhouse.com/blog/a-case-of-the-vanishing-cpu-a-linux-kernel-debugging-story](https://clickhouse.com/blog/a-case-of-the-vanishing-cpu-a-linux-kernel-debugging-story)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Linux](https://swe.quest/tags/linux.md) (Infrastructure)
- [Memory management](https://swe.quest/tags/memory-management.md) (Compilers & runtimes)
- [Debugging](https://swe.quest/tags/debugging.md) (Engineering practices)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Incidents & postmortems](https://swe.quest/tags/incident-response.md) (Reliability & operations)

## Prerequisites

- Linux memory management ([easy posts on Linux](https://swe.quest/tags/linux.md?difficulty=easy))
- cgroups
- perf and eBPF tracing ([easy posts on Linux](https://swe.quest/tags/linux.md?difficulty=easy))
- page cache ([easy posts on Caching](https://swe.quest/tags/caching.md?difficulty=easy))

## Keywords

ClickHouse Cloud, bpftrace, perf, eBPF, GCP, shrink\_lruvec, mmap\_lock, libunwind

## Related posts

- [Debugging Systems in the Cloud: MySQL, Kubernetes, and Cgroups](https://swe.quest/articles/debugging-systems-in-the-cloud-mysql-kubernetes-and-cgroups-a5ded3f862ca5b21.md): Shopify Engineering · 2021-10-21 · Hard · 8 min read · Debugging, Linux, MySQL, Kubernetes, Performance engineering
  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.
- [Not Everything Is Google’s Fault (Just Most Things)](https://swe.quest/articles/not-everything-is-google-s-fault-just-most-things-b3015e3825a86414.md): Railway · 2023-12-01 · Medium · 5 min read · Incidents & postmortems, Cloud platforms, Virtualization, Linux
  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.
- [How recurring network maintenance exposed 6 bugs](https://swe.quest/articles/how-recurring-network-maintenance-exposed-6-bugs-e0c55b4aaea1ee8f.md): Jane Street Tech Blog · 2026-10-02 · Hard · 20 min read · Debugging, DNS, Resilience, Functional programming, Linux
  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.
- [Core dump epidemiology: fixing an 18-year-old bug](https://swe.quest/articles/core-dump-epidemiology-fixing-an-18-year-old-bug-49f918c45e5e4eb3.md): OpenAI · 2026-06-30 · Hard · 16 min read · Debugging, C & C++, Linux, Hardware, Incidents & postmortems
  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.
- [Incident Report: Dec 1st, 2023](https://swe.quest/articles/incident-report-dec-1st-2023-5a206e52b47b3346.md): Railway · 2023-12-01 · Medium · 4 min read · Incidents & postmortems, Deployment, Virtualization, Observability, Cloud platforms
  A misconfigured new metrics collection agent sampled every process on each host at high frequency, driving heavy kernel-to-userspace memory transfers.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
