---
title: "A fine-grained network traffic analysis with Millisampler"
description: "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."
url: "https://swe.quest/articles/a-fine-grained-network-traffic-analysis-with-millisampler-199069a4bdff3c38"
canonical: "https://engineering.fb.com/2023/04/17/networking-traffic/millisampler-network-traffic-analysis/"
source: "Meta Engineering"
published: "2023-04-17"
difficulty: "hard"
kind: "Research"
reading_minutes: 4
tags: ["networking","observability","linux","datacenters","performance"]
---

# A fine-grained network traffic analysis with Millisampler

A post on [Meta Engineering](https://swe.quest/sources/meta.md), published 2023-04-17, 4 min read, Research. Original: [https://engineering.fb.com/2023/04/17/networking-traffic/millisampler-network-traffic-analysis/](https://engineering.fb.com/2023/04/17/networking-traffic/millisampler-network-traffic-analysis/)

## Summary

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.

Written by swe.quest, not by the author.

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

## Topics

- [Networking](https://swe.quest/tags/networking.md) (Infrastructure)
- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)
- [Linux](https://swe.quest/tags/linux.md) (Infrastructure)
- [Datacenters](https://swe.quest/tags/datacenters.md) (Infrastructure)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- TCP congestion control and ECN ([easy posts on Networking](https://swe.quest/tags/networking.md?difficulty=easy))
- eBPF and Linux tc ([easy posts on Linux](https://swe.quest/tags/linux.md?difficulty=easy))
- Data center networking ([easy posts on Datacenters](https://swe.quest/tags/datacenters.md?difficulty=easy))

## Keywords

Millisampler, eBPF, tc filter, ECN, Syncmillisampler, Meta

## Related posts

- [Networking is a black box, we used eBPF to open it](https://swe.quest/articles/networking-is-a-black-box-we-used-ebpf-to-open-it-1c84acda9aefedd8.md): Railway · 2026-02-17 · Medium · 8 min read · Observability, Linux, Networking, Analytics & OLAP, Product engineering
  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.
- [Scaling real-time file monitoring with eBPF: How we filtered billions of kernel events per minute](https://swe.quest/articles/scaling-real-time-file-monitoring-with-ebpf-how-we-filtered-billions-of-kernel-2f88f92ad0613fab.md): Datadog Engineering · 2025-11-18 · Medium · 9 min read · Linux, Threat detection, Performance engineering, Scaling
  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.
- [Reverse debugging at scale](https://swe.quest/articles/reverse-debugging-at-scale-38ad4795201fdcca.md): Meta Engineering · 2021-04-27 · Hard · 7 min read · Debugging, Developer tools, Hardware, Linux, Performance engineering
  Meta continuously records Intel Processor Trace (Intel PT) data for all running processes in production, keeping it in a bounded circular buffer.
- [Enforcing encryption at scale](https://swe.quest/articles/enforcing-encryption-at-scale-123c858612356c4f.md): Meta Engineering · 2021-07-12 · Hard · 7 min read · Linux, Security, Cryptography, Networking
  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.
- [Strobelight: A profiling service built on open source technology](https://swe.quest/articles/strobelight-a-profiling-service-built-on-open-source-technology-6a094fead0e4b62a.md): Meta Engineering · 2025-01-21 · Medium · 12 min read · Performance engineering, Observability, Linux, Cost optimization, Compilers
  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.

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)
