February 25, 2026
Bench-pressing bottlenecks, live!
Show HN: Django-xbench – slow endpoint aggregation for Django
Django devs hype a no-fuss speed meter while GraphQL users demand labels
TLDR: A tiny Django add-on now tracks slow pages over time and shows where time goes, without extra services. Commenters love the simplicity and in-memory design, but debate losing data on restarts and ask for better labeling of GraphQL requests and built‑in N+1 query detection.
Meet django-xbench, the tiny Django add-on that tells you where your page time goes—database vs app—and now it spotlights slow pages over time. The crowd swooned over the new rolling-window view, with creator yeongbin05 stating it “adds rolling-window aggregation to detect performance trends.” Even veteran tinkerer simonw did a double take at how it stores numbers: no database, no pricey service—just in-memory stats and standard Server‑Timing headers you can see in Chrome. Cue the hot takes: some call it “APM without the APM” (application performance monitoring), others worry what happens when the server restarts or scales out. Minimalists cheered; hoarders of metrics clutched their dashboards.
Then came the GraphQL plot twist. User blorenz loves the tool but wants a way to label all those one-size-fits-all /graphql URLs—ideally by reading a header so each operation lands in the right bucket. That sparked chatter about N+1 query detection (when a page makes way too many tiny database calls): it’s on the roadmap, and blorenz name‑dropped django-zeal as today’s fix. Meanwhile, devs joked about watching their backends on a “speed diet,” copy‑pasting headers like trophies, and benchmarking their benchmarks. Check simonw’s code peek here. The vibe: one-line install, instant visibility, and endless arguments about buckets and persistence.
Key Points
- •Django-xbench is a lightweight Django middleware that measures total request time, database time, application time, and query counts.
- •It exposes metrics via Server-Timing and X-Bench-Queries headers and supports optional per-request logging.
- •Integration is one-line in settings.py, with middleware placement controlling whether end-to-end or view-level time is measured.
- •The project includes tests (pytest, pytest-django) and a bundled demo Django project with example endpoints.
- •Compatibility covers Python 3.9+ and Django 3.2+, with a roadmap for DRF serialization timing, improved Server-Timing merging, and N+1 detection documentation.