Skip to content

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

Meta Engineering 4 min read Research hardMaster

A fine-grained network traffic analysis with Millisampler

Millisampler is a lightweight eBPF-based tc filter deployed across Meta's server fleet that records fine-grained network traffic time series at 100μs, 1ms and 10ms granularities: ingress/egress bytes, ECN-marked bytes, retransmissions, in-region vs cross-region traffic, and active connection counts estimated with a 128-bit sketch. Each run takes 2,000 samples using lock-free per-CPU counters, giving observation windows from 200ms to 20s with a fixed memory footprint, and stores data locally for on-demand analysis. Combined with coarser telemetry, it has exposed synchronized microbursts and incast patterns, helped root-cause a NIC driver bug that stalled packet delivery for milliseconds, and guided transport tuning.

Related posts

  • Networking is a black box, we used eBPF to open it

    Railway mediumAdept

    Railway's Network Flows feature uses eBPF hooks on container packet ingress and egress to show real-time traffic between services as pipes on the project canvas, with click-through access to flow logs and kernel drop codes. Raw socket buffers are enriched with ports, addresses, cgroup-to-service and peer-service lookups, batched at 10,000 flows, and written to ClickHouse at roughly a million rows per second. The first design had about a thousand hosts writing directly to ClickHouse, and ReplacingMergeTree merge overhead degraded the cluster. An intermediate ingestion service that cut the writers to three and made inserts far larger fixed it. The feature was motivated by support tickets blaming the platform network for what were almost always application misconfigurations.

  • Scaling real-time file monitoring with eBPF: How we filtered billions of kernel events per minute

    Datadog Engineering mediumAdept

    Datadog built file integrity monitoring on eBPF to capture file changes with process and container context, which periodic scans, inotify and auditd could not provide at scale. Their infrastructure produces over 10 billion file events per minute at roughly 5 KB each. Agent-side rule matching cuts what reaches the backend to about one million events per minute. In-kernel prefiltering goes further: static approvers are derived from detection rules, and dynamic discarders are pushed at runtime into LRU eBPF maps. Together they drop up to 94% of events before they hit the ring buffer, which lowers CPU use and prevents dropped events.

  • Reverse debugging at scale

    Meta Engineering hardMaster

    Meta continuously records Intel Processor Trace (Intel PT) data for all running processes in production, keeping it in a bounded circular buffer. An eBPF kernel probe notifies the collector within milliseconds of a crash, so the crashed process's trace is saved before other processes overwrite it. Traces and binaries are stored for offline analysis, where an LLDB plugin decodes taken and not-taken branches against the binary, symbolicates the executed instructions, and builds a function call tree that makes reverse-step-over and reverse breakpoints cheap. The same timestamped traces also support latency analysis that sampled call stacks miss, with visualization planned for Meta's Tracery tool and VSCode.

  • Enforcing encryption at scale

    Meta Engineering hardMaster

    Meta enforces TLS on internal service traffic with SSLWall, a host-level daemon plus eBPF programs that detect and cut off plaintext connections, chosen over L7 firewalls to keep the blast radius small and allow fine-grained rollout. It combines a tc-bpf filter, kprobes on tcp_connect and tcp_v6_destroy_sock, and BPF maps. It supports a passive monitoring mode, bypasses for BGP/SSH, and plaintext-then-TLS flows like STARTTLS and HTTP CONNECT. Lessons included handling TCP Fast Open ordering via kprobe prehandlers, BPF program size limits, and keeping CPU overhead trivial with early exits and arrays instead of LRU maps. For noncompliant long-tail apps, Transparent TLS uses a cgroup/connect6 BPF hook to redirect connect() calls to a local encrypting proxy, skipping connections that already use TLS.

  • Strobelight: A profiling service built on open source technology

    Meta Engineering mediumAdept

    Strobelight is Meta's fleet-wide profiling orchestrator, running 42 profilers (mostly eBPF-based, plus ad-hoc bpftrace scripts) on every production host with safeguards against PMU counter conflicts, concurrency limits and queuing. Default continuous profiling uses dynamic sampling that retunes run probability daily per service to hit target sample counts, with sample weights normalizing data for cross-host and cross-service comparison. LBR data feeds Meta's FDO pipeline (CSSPGO and BOLT), cutting CPU cycles up to 20% for top services, and one efficiency win alone saved an estimated 15,000 servers annually. Stack Schemas and thread-local Strobemeta enrich stacks with tags and request metadata, while a centralized symbolization service built on DWARF, gsym and blazesym avoids on-host debug-info parsing, relying on frame pointers in all user-space binaries.

The quest for software engineering knowledge.

Look:
Layout: