{
  "run": "local redirect benchmark, 2026-10-14",
  "commit": "cf1736f (last server change: 1afd3a1); server tree clean",
  "target": "http://localhost:8080/{slug}, one active link, 302 to https://example.com/k6",
  "path": "k6 -> Go API over plain HTTP (no proxy, no TLS) -> in-process cache; every click recorded through the Redis stream into PostgreSQL",
  "host": {
    "machine": "laptop, also running a desktop session, code editor and browser during the runs",
    "cpu": "Intel Core i7-8706G, 4 cores / 8 threads, up to 4.1 GHz",
    "memory": "16 GB",
    "os": "Ubuntu 26.04.1 LTS, Linux 7.0.0-38-generic"
  },
  "load_generator": {
    "tool": "k6 v0.57.0",
    "script": "benchmarks/2026-10-12-production/scripts/redirect-live.js in IbrahimIjai/sh.sh, with the warm-up timed from the scenario start",
    "location": "same laptop, so it shared the CPU with the services under test",
    "connections": "keep-alive, plain HTTP",
    "user_agent": "desktop Chrome string; every click was recorded as human (is_bot = false)"
  },
  "api": {
    "instances": 1,
    "process": "native, started with go run ./cmd/api (go1.26.2); no container or CPU limits, default GOMAXPROCS (8)",
    "app_env": "development (changes cookie flags, not the redirect path)",
    "settings": "defaults, except REQUEST_LOG=off and REDIS_URL=redis://localhost:6380/0",
    "click_queue": "redis"
  },
  "postgres": "PostgreSQL 17.11 (postgres:17-alpine) in Docker, default configuration, no resource limits, reached on localhost:5434",
  "redis": "Redis 7.2.16 (redis:7.2-alpine) in Docker, appendonly yes, maxmemory 256mb, volatile-lru, no resource limits, reached on localhost:6380",
  "runs": {
    "shape": "20 s ramp to the target rate, then 60 s held. Only the held window is reported in the hold_* metrics.",
    "summary-4000.json": "RATE=4000 PRE_VUS=400 MAX_VUS=2000",
    "summary-10000.json": "RATE=10000 PRE_VUS=500 MAX_VUS=3000; k6-10000.png is this run's terminal output",
    "earlier_attempt": "A previous 10,000 r/s run delivered 9,558 r/s during the hold (p95 39.3 ms, 26,727 dropped iterations, 0 errors) and stored all 683,104 clicks. Its summary was overwritten by the published run."
  },
  "reconciliation": {
    "method": "clicks for the test link counted in PostgreSQL before and after each run, once the stream had drained; sh:clicks and sh:clicks:dead lengths checked afterwards",
    "4000": { "requests_sent": 283945, "clicks_stored": 283945, "stream_after": 0, "dead_letter_after": 0 },
    "10000": { "requests_sent": 698171, "clicks_stored": 698171, "stream_after": 0, "dead_letter_after": 0 }
  },
  "measurement": {
    "cpu": "4000 run only: pidstat (api, k6, postgres, redis-server) and mpstat sampled every second for 58 s of the held window. Figures are in logical CPUs. Docker's port proxy, the kernel and desktop applications are not in the per-process figures. Hostnames are redacted.",
    "cpu_averages": { "api": 0.70, "postgres": 0.34, "redis": 0.02, "k6": 1.53, "host_idle_percent": 42.1 }
  }
}
