user@gryczka.dev: ~/garden/cloudflare-load-lab
$ cat ~/garden/cloudflare-load-lab/README.md
Load Lab — Global Load Testing on Cloudflare Containers screenshot

Load Lab — Global Load Testing on Cloudflare Containers

September 14, 2026 | Patrick Gryczka

## Overview

Load Lab turns a declarative HTTP test into a bounded global execution plan. A Worker validates each request, reserves capacity atomically, and hands authoritative run state to a per-run Durable Object. Six Container Durable Object classes point at one image but carry distinct placement constraints for Eastern and Western North America, Western and Eastern Europe, Asia Pacific, and South America. Each non-root Container runs an unmodified pinned k6 binary behind a small Go control agent, reports its actual Cloudflare region and location, waits at a shared future start barrier, and streams one-second metric deltas home. The coordinator sums counters, allocates delayed deltas across their callback intervals, replaces per-shard gauge contributions, and merges fixed latency histograms rather than averaging regional percentiles. It evaluates global thresholds, tracks sequence gaps, indexes summaries in D1, and stores downloadable reports in R2. The public garden is deliberately constrained to a fixed, owned endpoint and a server-controlled 20-second profile; custom targets require an administrator token plus an expiring ownership challenge or operator allowlist. A React interface built from Cloudflare Kumo components exposes requested-versus-actual placement, live generator health, and completed performance, reliability, and resource reports with keyboard-operated tabs and accessible raw-data tables. A YAML/JSON CLI provides idempotent CI runs, stable exit codes, remote cancellation, and JUnit output.

## Highlights

  • -> One global traffic budget is partitioned with largest-remainder allocation, so adding regional shards never multiplies requested load
  • -> Six placement-constrained Container classes reuse one image while surfacing requested pools beside actual runtime region, location, and country
  • -> Non-root Go agents prewarm an unmodified k6 2.2.0 process, synchronize on a future start barrier, stream one-second metrics, and support cancellation
  • -> Per-run Durable Objects merge counters and latency histograms, evaluate global thresholds, update the D1 index, and publish immutable R2 reports
  • -> Anonymous execution is pinned to an owned endpoint and low fixed limits; custom targets require Bearer authentication, ownership verification, and exact egress allowlists
  • -> Completed reports combine KPI summaries, normalized rates, latency envelopes, error-budget consumption, generator pressure, transfer volume, sequence-gap diagnostics, and accessible raw data

## Architecture

Load Lab architecture diagram
Browser / CLI / CI
    │   config + Bearer token
    ▼
Cloudflare Worker
    ├── edge Rate Limiting ───── anonymous start guardrail
    ├── BudgetCoordinator DO ─── atomic run + generator reservations
    ├── D1 ───────────────────── run and verified-target index
    └── R2 ───────────────────── immutable JSON reports
            │
            ▼
RunCoordinator Durable Object (one per run)
    ├── exact shard plan + readiness barrier
    ├── counters + mergeable latency histograms
    └── global thresholds + alarms + cancellation
            │
            ├── ENAM Container DO ─┐
            ├── WNAM Container DO ─┤
            ├── WEUR Container DO ─┤
            ├── EEUR Container DO ─┼── Go agent + pinned k6
            ├── APAC Container DO ─┤      │
            └── SAM  Container DO ─┘      └── exact-host egress
                                               ▼
                                      Verified target

## Tech Stack

WorkersContainersDurable ObjectsD1R2Rate LimitingReactTypeScript
$ _