Performance tuning

Find N+1 queries, cache hot paths, and keep p95 under control.

Measure before you optimize. Atlas exposes query logging, route timing, and cache hit ratios so you can find the real bottleneck.
Performance charts on a screen
Photo by Luke Chesser on Unsplash.

Quick wins

  • Cache config and routes in production.
  • Eager-load relationships you render in lists.
  • Paginate every unbounded collection.
  • Move email and PDF generation to queues.

Inspect queries

bashterminal
php atlas telescope:install
php atlas serve
# open /atlas/telescope and reproduce the slow page
TpageTauth+Tqueries+TrenderT_{page} \approx T_{auth} + T_{queries} + T_{render}
Danger
A single N+1 in a table of 50 rows often costs more than your entire controller. Fix relationships first.
SignalHealthyInvestigate
p95 latencyunder 300 msover 800 ms
Queries / requestunder 15over 40
Cache hit ratioover 90%under 60%

Updated Aug 5, 2026