Back to blog

Load Testing and Capacity Planning: The Pre-Launch Discipline That Finds Your Breaking Point Before Your Customers Do

Load Testing and Capacity Planning: The Pre-Launch Discipline That Finds Your Breaking Point Before Your Customers Do

It is 9:02 a.m. on launch day. The marketing email has just landed in 200,000 inboxes, and your checkout page has started returning errors. The code passed every test. The staging environment looked fine. What nobody checked was how the system behaves when thousands of real people arrive in the same ten minutes. At AEGONTECH LLC, we have watched this scene play out in more than one company's post-mortem, and it is almost always preventable with a few days of deliberate load testing.

Key Takeaways

  • Load testing answers a question functional tests cannot: how does the system behave under realistic concurrent demand, and where does it break first?
  • Test the bottleneck, not the average. Databases, connection pools and third-party APIs fail long before CPU does.
  • Capacity planning turns test results into a budget. You decide in advance how much headroom you buy, instead of discovering it during an outage.
  • Run tests continuously, not once. A baseline performance test in CI catches regressions the week they are introduced.
  • Define pass/fail in business terms (checkout p95 latency, error rate) so non-engineers can sign off on readiness.

Inline blog image 1

What Is Load Testing, and Why Isn't a Passing Test Suite Enough?

Load testing is the practice of simulating realistic user traffic against a system to measure latency, error rates and resource consumption before real users do it for you. A passing unit or integration suite proves the code is correct; it says nothing about whether the code is fast enough, at scale.

The difference matters because performance failures are rarely logic bugs. They are interactions: a query that takes 4 ms with 10 rows and 900 ms with 10 million, a connection pool of 20 that silently serializes 500 requests, a retry loop that turns a slow dependency into a self-inflicted denial of service. None of these show up when one developer clicks through a staging site.

Amazon famously reported that every additional 100 ms of latency cost roughly 1% of sales, and Google's research has long shown that the probability of a mobile visitor bouncing rises by about 32% as load time grows from one to three seconds. Whatever the exact figure for your product, the direction is not in doubt: slow is a form of downtime that does not page anyone.

Which Types of Performance Test Should You Actually Run?

Run four kinds, each answering a different question. Teams that run only one tend to be surprised by the other three.

  • Load test: expected peak traffic held for 20 to 60 minutes. Question: do we meet our latency and error targets on a normal busy day?
  • Stress test: traffic ramped past the expected peak until something breaks. Question: where is the ceiling, and does the system fail gracefully or catastrophically?
  • Spike test: a sudden jump, such as 10x traffic in 60 seconds. Question: can autoscaling and caches react fast enough? This is the launch-day and flash-sale scenario.
  • Soak test: moderate load held for 8 to 24 hours. Question: are there memory leaks, connection leaks or disk growth that only appear over time?

A useful rule: the stress test tells you the number, and the soak test tells you whether the number is real. A system that survives 5,000 requests per second for ten minutes but leaks memory at a steady rate is not a 5,000 RPS system.

How Do You Build a Test That Resembles Reality?

Start from production data, not guesses. The most common reason load tests give false comfort is an unrealistic traffic model: every virtual user hits the home page, the database is empty, and all requests are cache hits.

A realistic model has four ingredients:

  1. A traffic mix taken from analytics or logs. If 60% of production requests are reads, 30% are searches and 10% are writes, the test should look the same.
  2. Production-sized data. Use an anonymized copy or a generator that produces comparable volume and skew. A query planner chooses entirely different plans for 10,000 rows and 50 million.
  3. Think time and ramp-up. Real users pause between actions. Ramp load over minutes so caches, connection pools and autoscalers behave as they would in production.
  4. Third-party behavior. Payment gateways and email providers rate-limit you. Either test against their sandbox limits or model their latency, otherwise your test will exercise a path that cannot exist in production.

Open-source tools such as k6, Gatling and Locust are enough for most teams; they run in CI, are scripted in code (JavaScript, Scala and Python respectively) and can be versioned next to the application. Managed platforms add distributed load generation when a single machine cannot produce enough traffic.

Inline blog image 2

Where Do Systems Actually Break First?

Almost never at the CPU. In the load tests we run, the first bottleneck is typically one of five things, roughly in this order of frequency:

  1. Database connections and slow queries. A connection pool is a fixed-size queue; once exhausted, every additional request waits. PostgreSQL in particular degrades sharply when hundreds of direct connections compete, which is why a pooler such as PgBouncer is standard practice.
  2. A single hot row or lock. Inventory counters, sequence tables and "last updated" rows serialize writes no matter how many servers you add.
  3. Third-party APIs. Your system is only as fast as its slowest synchronous dependency.
  4. Missing or ineffective caching. Cache stampedes, where thousands of requests regenerate the same expired value simultaneously, can take down a database that was otherwise healthy.
  5. Thread, memory or file-descriptor limits inside the application runtime, for example a default Node.js or JVM configuration that was never tuned.

Little's Law gives a quick sanity check: concurrency equals throughput multiplied by latency. If your service handles 1,000 requests per second at 200 ms average latency, about 200 requests are in flight at any moment. If latency doubles under stress, the same traffic needs 400 concurrent workers, and a pool sized at 250 turns into a wall. Latency is not just a symptom of overload; it is the mechanism by which overload spreads.

What Is Capacity Planning, and How Does It Differ From Load Testing?

Capacity planning is the process of deciding how much infrastructure you need to meet future demand with an acceptable safety margin; load testing is the measurement that feeds it. One produces data, the other produces a decision.

A workable approach has four steps:

  1. Measure capacity per unit. If one application instance sustains 400 requests per second at your latency target, that is your unit of capacity.
  2. Forecast demand. Combine historical growth with known events: marketing campaigns, seasonal peaks, a partner integration going live.
  3. Add headroom. Many teams target 30 to 50% spare capacity at expected peak, so that one failed instance or one availability zone outage does not tip the system over.
  4. Convert it into cost. Headroom is not free, so show the business what each additional 10% of resilience costs per month and let them choose consciously.

This is where cloud elasticity helps but does not eliminate the need to plan. Autoscaling on AWS, Azure or GCP typically takes one to several minutes to add capacity, while a spike test may show your queue overflowing in thirty seconds. Pre-warming capacity before a known event is a perfectly respectable engineering decision.

Load Testing vs. Monitoring: Which One Do You Need?

You need both, because they cover opposite ends of the timeline. Load testing is pre-production and hypothetical; monitoring is production and factual. Testing tells you what should happen at 3x traffic; observability tells you what is happening right now, and whether your model of the system was right.

The practical link is to use the same metrics in both places. If your SLO says checkout p95 latency must stay under 800 ms with an error rate below 0.5%, those exact thresholds should be the pass/fail criteria of the load test and the alert thresholds in production. Then a test result is a prediction that production can confirm or refute.

How Do You Make Performance Testing Part of the Delivery Process?

Treat performance as a regression risk, the same as functionality. A lightweight approach that works in practice:

  • On every merge: a short smoke-level performance test (one to two minutes) on a critical path, failing the build if p95 latency regresses by more than, say, 20% against the previous baseline.
  • Nightly or weekly: a full load test in a production-like environment, with results stored so trends are visible.
  • Before major events: a stress and spike test against the expected peak plus a safety multiple, with the whole team in the room and a rollback plan ready.

At AEGONTECH, the same discipline underpins how we operate our own products. Dolfy.ai and Mimicall.app both involve bursty, user-triggered workloads, and the lesson has been consistent: the endpoints that looked cheap in design reviews were rarely the ones that saturated first. Measurement beat intuition every time.

Frequently Asked Questions

How much traffic should I test for? Test for your realistic peak, then for at least 2x that figure. Many teams use 3x for events they cannot rehearse, such as a product launch or press coverage. The goal is to know where the ceiling is, not to guess it.

Should I load test in production? Mostly no. Test in a production-like staging environment with comparable data and infrastructure sizing. Controlled production tests, using synthetic traffic and careful guardrails, make sense for mature teams that need to validate real network paths, but they carry risk and should never be the first approach.

How often should we run load tests? Run a small automated test on every significant change, a full test on a regular schedule, and a dedicated test before any known traffic event. A single test before launch decays in value with every release afterwards.

Is load testing worth it for a small product? Yes, scaled to size. A day of scripting one realistic scenario in k6 costs far less than a single outage during your first big customer demo. The investment grows with the stakes, not with the headcount.

Conclusion: Find the Breaking Point on Your Own Terms

Every system has a breaking point. The only choice is whether you find it in a quiet test window or in front of your customers. Realistic load tests, honest capacity planning and metrics shared between testing and production turn performance from a launch-day gamble into an engineering decision with known costs.

If your team is heading into a launch, a migration or a growth phase and wants an independent view of where the system will bend first, AEGONTECH LLC can help you design the tests, read the results and plan the capacity. Visit aegontech.dev to book a consultation.