Laravel Optimization Playbook
Finding the real bottleneck in a Laravel application under load
Laravel is fast enough; applications are slow for a small number of repeatable, measurable reasons, and those should be found in a fixed order rather than by rewriting.
An application that got slower as it got busier does not need a new framework. It needs to be measured, then worked through in a fixed order: the query layer, then write contention, then cache invalidation, then queue saturation, then the runtime. This book runs that order with a measurement at every stage, and ends with the budgets and regression gates that stop the win from decaying the week after you ship it.
What it makes operable
-
01
Profile before touching anything, and know which number you are moving
-
02
Work the query layer, write contention and cache invalidation in that order
-
03
Run queues, workers and Octane under load without introducing new failure modes
-
04
Hold the gains with performance budgets and regression gates
Contents
13 of 13 published
Every chapter is free to read in the browser, cites its own sources, and stands on its own if you came for one decision rather than the whole argument.
- 01 Measure Before You Touch Anything Profiles, traces, and a baseline that makes the next change arguable. 11 min
- 02 Where the Queue Forms: Workers, Connections, Utilisation Fixed pools, arrival rate, and why the ninety-ninth percentile breaks first. 11 min
- 03 The Query Layer: N+1, Indexes, and Eloquent Reality What Eloquent actually emits, and the indexes it assumes you added. 11 min
- 04 Reading at Scale: Pagination, Projections, Chunking Cursor pagination, narrower selects, and not hydrating a million models. 10 min
- 05 Writing at Scale: Transactions, Locks, Contention Lock scope, deadlocks, and the hot row that serialises your whole workload. 11 min
- 06 Cache Layers and Their Invalidation Tags, TTLs and stampedes, with an explicit rule for what may go stale. 11 min
- 07 Queues, Workers, and Horizon Under Load Head-of-line blocking, retry storms, and backlog age as the alarm that matters. 11 min
- 08 Octane and Long-Lived Processes State that leaks between requests once the process stops dying. 11 min
- 09 HTTP: Payloads, Compression, and the Edge Response size, cache headers, and work you can stop doing entirely. 10 min
- 10 Front-End Cost You Are Paying on the Server Every component update is a server round trip, and you are paying for all of them. 10 min
- 11 The PHP Runtime: 8.3 to 8.5, OPcache, JIT OPcache, preloading, and the JIT that PHP ships switched off. 11 min
- 12 Load Testing That Predicts Production Representative mixes, warm caches, and a test whose result you can believe. 11 min
- 13 Staying Fast: Budgets and Regression Gates Performance budgets in CI, so the improvement survives the next quarter. 11 min
Evidence · 1 sources
Third-party sources behind the book's premise. Every figure in them belongs to the party that published it and is attributed to them in the text.