Study Notebook / 06
Scaling and Performance
Where the time actually goes, and how you know
Latency is a distribution, not a number. Measure before you fix: percentiles, utilization and the knee, flame graphs, distributed tracing. Then the fixes, in the order they pay off.
- pages
- 100
- sections
- 46
- editions
- Reading, Print, Tablet
Sign in to read it
Sign in and the whole notebook opens, all three editions with it. An account is what makes a download belong to someone.
Sign in with GitHub or GoogleStart reading
How to use this book
What is inside
Every section, and every one of them opens in the browser. Nothing here is hidden: if a section you need is not in this list, the notebook is not the right one and you should not spend a week on it.
- How to use this book
- 1"Slow" is not a bug report
- 2Latency is a distribution, not a number
- 3Why P99 is your most valuable customers
- 4Throughput, and the curve that bends
- 5Utilization and the knee
- 6Headroom, and why traffic arrives in bursts
- 7Never guess. The week spent on the wrong fix
- 8Profiling, and what a flame graph shows
- 9Distributed tracing, and why waiting needs it
- 10What to measure, in what order
- 11N+1: the shape, not the name
- 12Indexes: the catalogue, the tree, and the cost
- 13Composite and covering indexes
- 14EXPLAIN ANALYZE: deciding instead of guessing
- 15Connections are not free
- 16Pooling, and the autoscaler that killed the database
- 17What caching actually buys
- 18Invalidation: the second hard problem
- 19Where the cache lives
- 20Three patterns: aside, through, behind
- 21Hit rate, and the four things that move it
- 22Vertical scaling, and its three ceilings
- 23Horizontal scaling, and the bill it comes with
- 24Statelessness is the price of admission
- 25The load balancer, and five algorithms
- 26Health checks, and the server that is up but dead
- 27Read replicas
- 28Replication lag, and the read-after-write bug
- 29Sharding, and the key that is hard to choose
- 30Distributed databases: rent, do not build
- 31The speed of light, and the latency budget
- 32CDNs: what goes on one
- 33The edge, and what it cannot do
- 34Asynchronous processing: the queue as a latency tool
- 35What can be made async, and what cannot
- 36Microservices scale teams, not machines
- 37What a network boundary costs
- 38Serverless: the pricing model is the point
- 39Cold starts, limits, and statelessness
- 40When serverless fits, and when it does not
- 41How to answer "how would you scale this?"
- 42Five traps
- 43The five rules
- Appendix A. Numbers worth memorising
- Appendix B. Glossary
- Appendix C. Final review
How to read it
Read with a pen. Every notebook opens with a question to answer before you start and asks you to redo the answer at the end, and the margin in the Print edition exists so you have somewhere to be wrong first. The Tablet edition is 16:9 with vector text, so note apps draw on it rather than treating it as a photograph.