Back to feed
Dev.to
Dev.to
6/25/2026
Three dumb ways our prod got slow (and not one was a slow algorithm)

Three dumb ways our prod got slow (and not one was a slow algorithm)

Short summary

A FastAPI LMS chasing production slowdowns found three non-algorithmic culprits: Supavisor transaction pooling silently dropped timeout configs (2min instead of 30s, fixed with SET LOCAL), KaTeX bundled twice bloating 84KB (dedupe and lazy-load only when math exists), and dashboard queries over-fetching thousands of rows to render hundreds (solved with slim schemas). Production debugging means asking what built this input, not what makes this query slow.

  • Transaction pooler silently drops libpq startup options—use SET LOCAL within transactions, not connection-time config
  • Dependency duplication: KaTeX shipped twice via direct import and rich-text editor; deduplicate and lazy-load only when content has formulas
  • Over-fetching: dashboard loaded full module tree for course cards, progress endpoint returned all students' data to compute totals—fix with slim schemas and lazy-loading

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Explore more