---
title: "Networking is a black box, we used eBPF to open it"
description: "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."
url: "https://swe.quest/articles/networking-is-a-black-box-we-used-ebpf-to-open-it-1c84acda9aefedd8"
canonical: "https://blog.railway.com/p/network-flows-in-railway"
source: "Railway"
published: "2026-02-17"
difficulty: "medium"
kind: "Case study"
reading_minutes: 8
tags: ["observability","linux","networking","analytics","product-engineering"]
---

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

A post on [Railway](https://swe.quest/sources/railway.md), published 2026-02-17, 8 min read, Case study. Original: [https://blog.railway.com/p/network-flows-in-railway](https://blog.railway.com/p/network-flows-in-railway)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)
- [Linux](https://swe.quest/tags/linux.md) (Infrastructure)
- [Networking](https://swe.quest/tags/networking.md) (Infrastructure)
- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Product engineering](https://swe.quest/tags/product-engineering.md) (Engineering organization)

## Prerequisites

- TCP/IP basics ([easy posts on Networking](https://swe.quest/tags/networking.md?difficulty=easy))
- eBPF concepts ([easy posts on Linux](https://swe.quest/tags/linux.md?difficulty=easy))
- ClickHouse MergeTree ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))

## Keywords

eBPF, ClickHouse, ReplacingMergeTree, Railway, Network Flows, tcpdump

## Related posts

- [How BENOCS uses ClickHouse to monitor network traffic for the world’s biggest telcos](https://swe.quest/articles/how-benocs-uses-clickhouse-to-monitor-network-traffic-for-the-world-s-biggest-2c1a0883825ce194.md): ClickHouse · 2022-03-22 · Easy · 4 min read · Analytics & OLAP, Data pipelines, Networking
  BENOCS builds its Flow Analytics network-traffic monitoring for large telcos on ClickHouse, processing dozens of terabytes of asynchronous feeds per day through a self-healing push pipeline that computes results as each feed's data arrives and backfills when late data shows up.
- [How LY Corporation uses ClickHouse to observe one of the largest Kafka deployments on earth](https://swe.quest/articles/how-ly-corporation-uses-clickhouse-to-observe-one-of-the-largest-kafka-4673da61e0f144c7.md): ClickHouse · 2026-02-09 · Medium · 6 min read · Observability, Queues & messaging, Analytics & OLAP, Debugging
  LY Corporation (LINE + Yahoo! Japan) runs a Kafka platform of 200+ brokers serving 25,000+ clients and handling 31M messages/sec at peak, over 1 trillion messages and 2.6 PB of I/O per day.
- [Our New Observability Platform for 100B Logs](https://swe.quest/articles/our-new-observability-platform-for-100b-logs-ffdc8340b285c59b.md): Railway · 2023-09-29 · Medium · 7 min read · Observability, Analytics & OLAP, Replication, Scaling
  Railway rebuilt its logging backend on ClickHouse to power Log Explorer, handling about 1 billion new logs per day, 100 billion stored logs and 60 queries/sec at roughly 50ms average latency on a 2-shard/2-replica cluster.
- [Why Flock Safety turned to ClickHouse for real-time vehicle traffic analytics](https://swe.quest/articles/why-flock-safety-turned-to-clickhouse-for-real-time-vehicle-traffic-analytics-f35b2dcb28006f8a.md): ClickHouse · 2025-04-29 · Medium · 5 min read · Analytics & OLAP, Data pipelines, Cloud platforms
  Flock Safety replaced a once-daily Redshift, DBT, Prefect and QuickSight SPICE pipeline with ClickHouse Cloud.
- [OONI Powers its Measurement of Internet Censorship with ClickHouse](https://swe.quest/articles/ooni-powers-its-measurement-of-internet-censorship-with-clickhouse-6ee2ad4e0a344636.md): ClickHouse · 2023-05-19 · Medium · 4 min read · Analytics & OLAP, Databases, PostgreSQL, Performance engineering
  OONI, a non-profit that measures internet censorship through volunteer-run probes, replaced flat files, MongoDB and PostgreSQL with ClickHouse to store measurement metadata in a single 1.4-billion-row ReplacingMergeTree table, while raw JSON stays on S3.

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)
