When designing a fleet continuous profiler, normalize ASLR offsets on-node, deduplicate ELF debuginfo by Build-ID, and store dictionary-encoded Parquet blocks.
TL;DR30-second simplified summary▾
Sending (build_id, offset, count) tuples shrinks ingestion from 26 TB/day to 345 GB/day in dictionary Parquet, while normalized v2% - v1% diffs catch canary regressions in <500 ms.
stack_id aggregation, .eh_frame unwinding, and Build-ID symbolization.R & E · Requirements, Fleet Bandwidth & Storage Sizing.
10,000 nodes sending raw 15 KB unsymbolized profiles every 10s = 10,000 * 1.5 KB/s = 15 MB/s cluster-wide!
Illustrative Sizing: Compare that against naive stringified profiles (~300 KB/10s/node = 300 MB/s = 26 TB/day!). With Build-ID deduplication + Zstd columnar blocks, 15 MB/s raw drops to ~4 MB/s compressed = 345 GB/day = ~10.3 TB for 30-day retention in S3.
Stringified Profiles (26 TB/day) vs. Build-ID + Dictionary Parquet (345 GB/day)
- 300 MB/s repeated string uploads
- 26 TB/day uncompressed churn
- High CPU/RAM on node agents
- 15 MB/s compact offset tuples
- Debuginfo uploaded once/Build-ID
- 345 GB/day compressed in S3
S · Storage: Symbol Dictionary + Prefix-Tree Parquet Blocks.
Across a 10-second window on 1,000 pods of checkout-svc, 99% of stack frames repeat the exact same call paths (main -> handleHTTP -> parseJSON).
Ingestion interns every (function_name, file, line) into a per-block Symbol Dictionary (uint32 sym_id), encodes each unique stack as a Prefix Tree / LOUDS array (parent_node_id, sym_id), and writes only (stack_node_id, self_value, total_value) columns into Zstd Parquet files.
Symbol Dict (uint32) -> Prefix Tree Nodes -> Sample Values (Zstd Parquet)
H & A · DaemonSet Agent, Debuginfo Cache & Query Fan-Out.
Each Kubernetes node runs a single privileged eBPF DaemonSet pod with CAP_BPF and CAP_PERFMON—zero sidecars or app restarts needed.
Every 10s, the DaemonSet reads aggregated maps, maps RIP virtual addresses to (build_id, file_offset) using /proc/<pid>/maps, and pushes the compact batch to Ingestion Gateways. When a new build_id appears, the agent checks EXISTS /debuginfo/{build_id} and uploads stripped symbols once (CI/CD can also push debuginfo directly at build time).
eBPF Agent -> Build-ID Check -> Ingest Parquet -> Diff Flamegraph
D · Detailed Design: Differential Flame Graphs & Span Correlation.
Comparing raw sample counts between v1 (100 pods) and v2 (10 canary pods) is misleading because v1 has 10x more total samples!
A Differential Flame Graph normalizes both trees to percentage of total samples (pct_v1, pct_v2) and computes delta = pct_v2 - pct_v1 at every (parent_path, func_name) node. Nodes where delta > 0 glow red (regression); nodes where delta < 0 glow blue (speedup).
New Build-ID -> Check S3 Cache -> Upload Once (or CI Push) -> Symbolized
- Problem
- How to symbolize and store profiles across 10,000 nodes without wasting bandwidth or miscomparing canary deployments.
- Naive Solution
- Symbolize strings on every node and compare raw sample counts between
v1andv2. - Why It Fails
- Node-side symbolization wastes 26 TB/day and crashes agents on large ELF files; raw counts falsely flag 100-pod
v1as slower than 10-podv2. - Alternatives
- Node-side symbolization vs. Build-ID deduplicated server symbolization + normalized diff trees.
- Engineering Decision
- Deduplicate debuginfo by Build-ID in S3, store dictionary-encoded Parquet blocks, and normalize differential flame graphs by percentage share.
- Trade-Offs
- Requires CI/CD or agent debuginfo upload for stripped binaries in exchange for 20x–75x lower storage and <500 ms diff queries.
You deploy v2 to 5% canary pods (10 pods) alongside v1 (190 pods). On a raw-count differential flame graph, every function in v2 looks 19x smaller (bright blue) even though v2 actually introduced an O(N^2) CPU regression. What bug caused this?
E & D · Evaluation, Assumptions, Limitations & Glossary.
Translating ASLR-randomized runtime addresses requires subtracting the binary's base_load_addr from /proc/<pid>/maps so all pods share identical relative file offsets.
Assumptions & Limitations: Sizing assumes 10,000 nodes at 19 Hz (~15 MB/s raw, ~345 GB/day Zstd Parquet) and Linux kernels >=5.8 with CAP_BPF/CAP_PERFMON. In multi-tenant serverless sandboxes (e.g., Firecracker or gVisor) where host eBPF cannot inspect guest internals or lacks CAP_BPF, use in-process pprof/JFR HTTP scraping instead.
eBPF DaemonSets -> Build-ID S3 Cache -> Dict Parquet -> Diff Query Engine
Practice: Make the trade-off yourself.
Why must eBPF agents subtract the binary's ASLR `base_load_addr` (from `/proc/<pid>/maps`) before sending stack addresses to the backend?