Magento 2 Load Testing & Capacity Planning: Know Your Limits Before Traffic Does
Every Magento 2 team has the same nightmare: a flash sale goes live, traffic triples, and the site turns into a spinning wheel of death. The store survives — barely — but orders drop, support tickets explode, and the post-mortem reveals the same sentence: "We didn't know it would break at that load." You can know. Load testing is the difference between guessing your limits and measuring them. This article covers the full loop: designing realistic tests, generating load that actually resembles your shoppers, reading the results to find the real bottleneck, and turning those numbers into capacity decisions. Why Load Testing Is Not Regression Testing If you've read our article on automated performance regression testing in CI , you know that's about catching slowdowns between deploys — a few requests, tight budgets, fail the build if TTFB climbs. Load testing answers a different question: how much traffic can this system handle before it degrades or dies? One focuses on change detection; the other on absolute capacity. You need both. Regression testing keeps you from getting slower; load testing tells you where the cliff is, and whether one node survives a flash sale or you need five. Define What "Good" Means Before You Start A load test without acceptance criteria is just a benchmark with anxiety. Define SLOs first, ideally from real traffic data: p95 Time To First Byte (TTFB) under load — e.g., under 800ms Error rate — under 0.5% (502s, timeouts, checkout failures) Throughput — X requests/second sustainable for 30+ minutes Business metrics — successful checkout completion rate over 99% Then define the shape of traffic. Magento 2 is not a static site: different pages cost wildly different amounts. A realistic mix for a typical store looks something like: 40% category/product listing pages (PHP + FPC + Elasticsearch aggregations) 30% product detail pages (heavily cached, cheap when warm) 15% home + CMS pages (nearly free with FPC) 10% cart + checkout actions (uncached,