Technology

Load testing: find out why your application crashes

Measure the real peak in your logs, replay it, find the bottleneck (database, pools, memory, external calls) and get a signed load test plan.

Load testing: find out why your application crashes
Contents
  1. Which log file should you ask operations for today?
  2. Why does an application that's fine in the morning crash in the evening?
  3. How do you derive the target load from your own logs?
  4. How do you build a load profile that looks like your users?
  5. Load, stress, soak: which test answers which question?
  6. Where is the bottleneck: database, pools, memory or external calls?
  7. How do you prove the cause instead of assuming it?
  8. What load test plan should be signed before you start?
  9. Why does an online travel platform go down on promotion nights?
  10. FAQ
  11. Sources

An application that copes all day and falls over at peak has almost always run out of a finite resource that only high concurrency uses up: database connections, application server threads, memory, or time spent waiting on an external service. To prove which one, you first measure the real peak, minute by minute, in your logs. A test then replays that peak on an environment close to production while every layer is measured on the same clock, which lets you name the first resource to saturate instead of guessing.

The hour your application goes down is usually the hour it was meant to earn the most: the promotion evening, the month-end close, payday. Lost sales don't always come back the next day, and while the call centre absorbs the customers' anger, development blames the hosting and the host blames the code. Someone then doubles the servers, which changes nothing when the limit is a pool setting or a slow supplier. Slowness that persists off-peak is a different diagnosis, covered in our guide to slow websites.

Which log file should you ask operations for today?

Ask for the access logs from the web server or load balancer for the last day the application failed. A short script or a spreadsheet will count requests per minute, and the whole exercise fits in a morning.

Note four numbers: the busiest minute, the daily average, the time of the first 5xx errors, and the response time just before those errors. The gap between peak and average usually surprises people, since dashboards show hourly averages that flatten the spikes. If those logs aren't kept, your first decision is to extend their retention before the next peak.

Why does an application that's fine in the morning crash in the evening?

A system answers at roughly the same speed as long as none of its resources is full. Once one of them saturates, requests queue and response time shoots up. Little's Law explains the mechanism: the average number of requests in progress equals the arrival rate multiplied by the average time each one spends in the system (L = λW). An application receiving 30 requests per second, each taking one second, handles 30 at once on average. If response time goes to four seconds because a supplier slows down, the same traffic means 120 requests in flight. Threads and connections fill up, and the waiting makes response time longer still.

Several defaults set these ceilings without anyone choosing them. HikariCP, the connection pool Spring Boot picks whenever it is available, opens at most 10 connections and makes a request wait up to 30 seconds before returning an error. PostgreSQL typically accepts 100 simultaneous connections by default. These values are fine for getting started, but nobody resizes them without knowing they exist.

How do you derive the target load from your own logs?

Start from the busiest day of the year, count requests per minute on that day and keep the highest minute. Then split that minute by user journey: search, browsing, login, booking, payment. A test that only replays the home page mostly measures the cache. The target load is the observed peak multiplied by a margin, a commercial call the executive committee makes according to expected growth and planned campaigns.

How do you build a load profile that looks like your users?

A good profile reproduces the journey mix, the arrival rate and the variety of data. Your customers don't wait for the server to respond before they show up. A test built on a fixed number of virtual users, each waiting for a reply before trying again, slows down along with the system and hides the saturation. Configure an arrival rate per second instead, which the tool keeps up whatever happens.

A thousand identical searches for Paris on the same date land in the cache and flatter the result; draw destinations, dates and customer accounts from a real, anonymised sample. The payment gateway and partner APIs can't be load tested without their owners' agreement, so replace them with a stub set to the delay in your peak-hour logs, not the one in their documentation.

Load, stress, soak: which test answers which question?

The k6 documentation describes six test types, including stress tests (load above the expected average level) and soak tests (over extended periods). For an executive audience, four are enough.

TestQuestionLoad shapeWhat it shows
LoadDo we hold the target peak?Ramp up, then hold at target loadResponse times and errors at the level you need
StressWhere and how do we break?Increasing steps beyond the targetThe first resource to saturate, and recovery afterwards
SoakDo we last?Peak load for several hoursMemory leaks, connections never released
SpikeDo we survive a sudden rush?Jump from low load to peakInstance start-up, load shedding

k6 (AGPL-3.0 licence, JavaScript scripts), Apache JMeter (open source, graphical interface) and Gatling (Community Edition under Apache 2.0) can all do the job. Pick the one your team can read, because the test will come back for every major release. Watch the CPU of the machine generating load too, so it doesn't become the bottleneck, and warn your host or network team before the run, or a web application firewall may block the test.

Where is the bottleneck: database, pools, memory or external calls?

The bottleneck is whatever saturates first. The database saturates through slow queries, locks or a missing index. Pools give themselves away through time spent waiting for a free connection or thread. Each setting can look reasonable on its own while six application instances with a pool of 20 connections each ask for 120 connections from a database that may accept 100, and the limit hits exactly when you add servers to survive the peak.

Memory problems only show over time. Usage that climbs without coming down, or garbage collection pauses that keep getting longer, point to a leak that only a soak test will catch. An external call with no timeout holds a thread for as long as the other side takes to answer, which is why every outgoing call needs a timeout, a fallback response and its own measurement. If the bottleneck lies outside the application (network, hosting, integrations), a digital audit looks at the rest of the system.

How do you prove the cause instead of assuming it?

A cause is proven when you can trigger it and make it go away. First reproduce the outage in test, at the load observed on the day of the incident, with the same signature (same saturated resource, same errors). Then change one setting, replay the same profile and compare the curves. Keep every run with its date, version and graphs, because that record settles arguments between development, the host and the software vendor.

What load test plan should be signed before you start?

The plan fits on one page and is signed before the first run. The thresholds in the right-hand column are parameters for IT and the business owner to agree between them.

SectionWhat to writeParameter to agree
ScopeApplication, version, test dateVersion frozen for the whole campaign
EnvironmentDifferences from production (size, data, network)Accepted gaps and who owns them
ScenariosJourneys replayed and the weight of each, taken from logsSplit as a % of the observed peak
Target loadObserved peak per minute multiplied by the marginMargin multiplier
Tests and durationsLoad, stress, soak, spikeLength of each step and of the soak
Success criteria95th percentile response time per journey, error rate, sustained throughputThreshold per journey (payment stricter than search)
ResourcesCPU, pools, connections under a ceiling; memory stable during the soakCeiling per resource, drift allowed
Metrics to capturePer layer: load balancer, application, pools, database, outgoing calls, load generatorSampling interval (second or minute)
Data and stubsAnonymised data set, delays for external stubsDelays taken from peak-hour logs
Stop and safetyStop criteria, time window, people notifiedImmediate stop threshold
Sign-offRuns it: test team. Analyses: architect. Signs: CIO and business ownerDecision: go, go with conditions, no go

The business owner signs the criteria because they know how long a customer will wait at payment; the CIO signs the conclusion. A UAT sign-off works the same way, with its criteria also fixed before the test.

Why does an online travel platform go down on promotion nights?

An online travel agency sells holidays and flights from Casablanca. The company and its figures are invented for illustration. On an ordinary day the platform receives 180,000 requests, an average of 125 per minute. On the evening of its last promotion, the logs show 2,400 requests per minute at 9 p.m., and the first 5xx errors appear three minutes later.

The peak minute breaks down into 1,680 searches (70%), 480 offer views (20%), 192 booking steps (8%) and 48 payments (2%), which makes 2,400. Every search queries a partner's availability API, which answers in 1.5 seconds on a normal day and took 8 seconds that evening, since every agency was pushing offers at the same time. The application runs on two instances with 100 threads each, 200 threads in all.

1,680 searches a minute is 28 a second. By Little's Law, 28 × 1.5 means 42 busy threads on a normal day, and 28 × 8 means 224 on promotion night, more than the 200 available. Payments end up queuing behind searches, and the test confirms it. At 2,400 requests per minute with a stub set to 1.5 seconds, the platform holds; with the same stub set to 8 seconds, all 200 threads are taken in under three minutes and the errors return. Only the partner's delay changed between the two runs.

The team sets a 3-second timeout on the partner call, with a fallback: past that, the search shows the last cached availability, marked "to be confirmed". The committee picks a margin of 1.5, giving a target of 3,600 requests per minute. At that level, 2,520 searches a minute is 42 a second, and 42 × 3 occupies at most 126 threads, with the stub still set to 8 seconds. The load test passes, with fallback answers counted as successes under the signed criterion. The stress test then finds the breaking point at around 5,500 requests per minute, about 2.3 times the observed peak. Finally, a four-hour soak at 2,400 requests per minute shows memory on one instance climbing from 1.2 to 3.1 GB and never coming down, caused by a session cache with no expiry, which is fixed before the next promotion.

FAQ

Can we run the test directly in production?

It's possible at night, on an empty platform, with stubs instead of payments and your host's written agreement. Most teams test on a pre-production environment with the same architecture, then check in production, under light load, that the settings they found are actually applied.

Our host says we just need more servers. Are they wrong?

More servers help when the saturated resource is the instances' CPU or memory. If the limit is in the database, a connection pool or a slow partner, extra servers don't move it, and they can make things worse by multiplying connections to the database. Ask for a test result before you pay the invoice.

How often should we repeat a load test?

Before every major release, before every known peak (promotion, close, season) and after any change of infrastructure or partner. If the scripts are versioned with the code, a reduced run can go out with every release and catch a performance regression before customers do.

Sources

Last verified: 2 November 2026.

Our free audit can go through the logs from your last peak-hour incident with you and draft the test plan before anyone orders more servers. The fix itself falls under custom development. By default, HikariCP opens only 10 connections per pool, a value worth checking in your configuration before the next peak.

Read next

  1. Technology

    Legacy modernisation without stopping the business

    Replace a legacy system module by module with no big-bang cutover: an API layer in front, parallel runs, rollback triggers and a sequencing table.

    11 min read

  2. Technology

    UAT sign-off: template and acceptance rules

    A UAT sign-off template to copy and sign, a blocking, major and minor severity grid, and the re-test rules to agree before development starts.

    10 min read

  3. Technology

    Vendor lock-in: how to avoid it with an API-first design

    Six requirements to write into your specification so you can connect your tools and change vendors later, with the test that checks each one before you sign.

    10 min read

  4. Technology

    Payment milestones: tie each payment to a delivery

    A milestone payment schedule to copy: deliverable, acceptance evidence, decision deadline and what happens when either side runs late. No prepayment.

    11 min read

Let's discuss your priorities

A free audit of your information system.

For companies of 50 people or more, or with several sites, with a decision-maker present. Two to four hours of interviews, then a written report that is yours to keep.

* Required field

Only if you'd rather we called you.

A few words are enough. Don't include passwords or sensitive data.

We use this information to reply to your inquiry and, if you've accepted cookies, to measure how well our campaigns perform. To find out how it's stored and how to exercise your rights, see our privacy policy.

Would you rather talk it through?Call us on +212 715 659 190