The dashboard of an organization with 3,500 monitors took 4.4 s in production (582 KB page).
Reproduced locally with 3,500 monitors in 4 regions, 2 groups and 24 h of results:
Range picker (earliestData) dropped: it queried the real-time daily aggregate, which aggregates the not yet materialized raw results (up to ~2 h of every monitor and region) on every request, plus up to one index lookup per monitor. The oldest monitor's created_at bounds the offered ranges now.
Sorting computed each row's key (fmt.Sprintf, uuid.Parse, ToLower) per comparison and swapped large structs; keys are computed once and rows moved once. 40–60 ms → ~5 ms.
Queries behind the monitor list run in four parallel transactions; the database is remote in production.
GET /api/v1/org/monitors reads latest results for the page's monitors instead of the whole organization on every page.
Server-Timing header on the dashboard (load, arrange, bars, rest) and a slow console page warning with the steps when it takes ≥ 1 s, so production timings are visible without touching the database.
Local dashboard: ~400–600 ms → ~190 ms.
Still raw: the 24 h bars (≈ 576k rows for ~100 shown monitors); the Server-Timing in production will tell whether they need the hourly aggregate.
The dashboard of an organization with 3,500 monitors took 4.4 s in production (582 KB page).
Reproduced locally with 3,500 monitors in 4 regions, 2 groups and 24 h of results:
- **Range picker** (`earliestData`) dropped: it queried the real-time daily aggregate, which aggregates the not yet materialized raw results (up to ~2 h of every monitor and region) on every request, plus up to one index lookup per monitor. The oldest monitor's `created_at` bounds the offered ranges now.
- **Sorting** computed each row's key (`fmt.Sprintf`, `uuid.Parse`, `ToLower`) per comparison and swapped large structs; keys are computed once and rows moved once. 40–60 ms → ~5 ms.
- **Queries** behind the monitor list run in four parallel transactions; the database is remote in production.
- **`GET /api/v1/org/monitors`** reads latest results for the page's monitors instead of the whole organization on every page.
- **Server-Timing** header on the dashboard (`load`, `arrange`, `bars`, `rest`) and a `slow console page` warning with the steps when it takes ≥ 1 s, so production timings are visible without touching the database.
Local dashboard: ~400–600 ms → ~190 ms.
Still raw: the 24 h bars (≈ 576k rows for ~100 shown monitors); the Server-Timing in production will tell whether they need the hourly aggregate.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
- The range picker no longer looks for the first result: on the real-time
daily aggregate that aggregated the organization's recent raw results
on every request. The oldest monitor's creation bounds the ranges now.
- Sorting worked out each row's key per comparison; it does so once now
and moves each row once (40-60 ms to 5 ms for 3,500 monitors).
- The queries behind the monitor list run in parallel.
- The monitor API reads the latest results of the page's monitors only.
- The dashboard reports its steps in a Server-Timing header and logs
them when it takes a second or more.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
The default range bucketed raw results by 30 minutes: for the hundred or
so monitors a dashboard shows, half a million rows on every request. It
shows 24 hourly bars from the real-time hourly aggregate now (bars 150-230
ms to 18 ms locally, the page 570 KB to 335 KB for 3,500 monitors).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi
merged commit 383b63bc0e into main2026-11-26 20:55:56 +00:00
Sebi
deleted branch perf/dashboard-large-orgs2026-11-26 20:55:58 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The dashboard of an organization with 3,500 monitors took 4.4 s in production (582 KB page).
Reproduced locally with 3,500 monitors in 4 regions, 2 groups and 24 h of results:
earliestData) dropped: it queried the real-time daily aggregate, which aggregates the not yet materialized raw results (up to ~2 h of every monitor and region) on every request, plus up to one index lookup per monitor. The oldest monitor'screated_atbounds the offered ranges now.fmt.Sprintf,uuid.Parse,ToLower) per comparison and swapped large structs; keys are computed once and rows moved once. 40–60 ms → ~5 ms.GET /api/v1/org/monitorsreads latest results for the page's monitors instead of the whole organization on every page.load,arrange,bars,rest) and aslow console pagewarning with the steps when it takes ≥ 1 s, so production timings are visible without touching the database.Local dashboard: ~400–600 ms → ~190 ms.
Still raw: the 24 h bars (≈ 576k rows for ~100 shown monitors); the Server-Timing in production will tell whether they need the hourly aggregate.
🤖 Generated with Claude Code
https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Added: 24 h bars come from the real-time hourly aggregate (24 hourly bars instead of 48 half-hourly ones). Locally with 3,500 monitors: bars 150–230 ms → 18 ms, page 570 KB → 335 KB, dashboard ~170 ms.