Open-Source Wikis

/

Pingora

/

By the numbers

cloudflare/pingora

By the numbers

Data collected on 2026-04-30 from git log and the working tree at HEAD (452813e).

Size

  • 97 files of Rust source (*.rs), excluding target/
  • 81,185 total lines across those files
  • 21 workspace crates declared in the root Cargo.toml
  • ~29 files matching tests/, benches/, or *test*.rs

The codebase is overwhelmingly Rust. The only non-Rust source is YAML CI config and Markdown docs.

xychart-beta horizontal
    title "Lines of code by area (approximate)"
    x-axis ["pingora-core","pingora-proxy","pingora-cache","pingora-load-balancing","tinyufo","pingora-http","pingora-lru","pingora-cache (eviction)","others"]
    y-axis "kLOC" 0 --> 25
    bar [22, 14, 12, 4, 4, 4, 5, 1, 15]

The largest single file in the workspace is pingora-proxy/src/proxy_cache.rs at roughly 100K bytes — it implements the cache-aware HTTP proxy loop. proxy_h1.rs and proxy_h2.rs are each ~45K bytes. pingora-cache/src/lib.rs is ~65K. These four files contain the bulk of the proxy state machine.

Activity

  • First commit: 2023-05-08 (open-sourcing of the codebase)
  • Most recent commit: 2026-04-23 (ci: add Semgrep OSS scanning workflow)
  • Total commits on main: 598
  • Years active: 2023, 2024, 2025, 2026

Commits per year on the public history:

Year Commits
2023 1 (initial drop)
2024 294
2025 210
2026 93 (through April)

Commits in the most recent ~12 months:

Month Commits
2025-05 16
2025-06 22
2025-07 8
2025-08 15
2025-09 12
2025-10 25
2025-11 25
2025-12 16
2026-01 28
2026-02 26
2026-03 32
2026-04 7

Bot-attributed commits

The git history shows 0 commits with a [bot] co-author trailer. Bot-driven dependency bumps and code-review automation are not part of the public history. This is a lower bound on AI-assisted work — inline AI tooling leaves no trace in commits.

Complexity

The biggest source files (a rough proxy for "where the complexity lives"):

File Lines (approx)
pingora-proxy/src/proxy_cache.rs ~2,800
pingora-cache/src/lib.rs ~1,800
pingora-proxy/src/lib.rs ~1,500
pingora-proxy/src/proxy_h2.rs ~1,300
pingora-proxy/src/proxy_h1.rs ~1,300
pingora-proxy/src/proxy_custom.rs ~1,300
pingora-http/src/lib.rs ~1,100
pingora-load-balancing/src/lib.rs ~900
pingora-load-balancing/src/health_check.rs ~700
pingora-pool/src/connection.rs ~900
pingora-core/src/server/mod.rs ~800

The handful of multi-thousand-line files in pingora-proxy/src/ and pingora-cache/src/ are state machines, not collections of many small functions. They're long because the protocols they implement (HTTP/1, HTTP/2, RFC 9111 caching) are inherently stateful.

Workspace shape

The workspace is "wide and shallow": 21 crates, only one of them (pingora-core) deeply hierarchical. Most leaf crates are a single lib.rs plus a couple of helper modules. The umbrella pingora crate adds zero original logic — it re-exports and gates feature flags.

Tests

Integration tests live alongside their crates:

  • pingora-core/tests/ — 4 directories of TCP/TLS/HTTP integration tests
  • pingora-proxy/tests/ — proxy-level tests using a small in-process backend
  • Per-crate #[cfg(test)] modules in every lib.rs

The tinyufo crate ships benches/ (criterion benchmarks). pingora-ketama and pingora-lru also have benchmarks.

Dependency footprint

The root Cargo.toml pins workspace versions for tokio, bytes, http, async-trait, httparse, h2, log, bstr, derivative, lru, ahash, once_cell, and tokio-stream. Concrete numbers are in reference/dependencies.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

By the numbers – Pingora wiki | Factory