Traffic does not always grow politely. When tickets go on sale at 10:00, thousands of people press the button at 10:00. When a newsletter goes out, a large share of the readers who will ever open it do so in the first half hour. A site that handled 300 users added over ten minutes in a load test can fail when the same 300 arrive in one minute.

Why a sudden rise is harder than a gradual one

The same number of users can be harmless or fatal depending on how fast they arrive:

  • Autoscaling is too slow. New servers or containers usually take minutes to start and pass health checks. A gradual rise gives them time; a spike is over before they are ready.
  • Caches are cold. Pages that are normally served from a cache are built from scratch for the first visitors, all at the same time. The database receives the same expensive query hundreds of times in parallel.
  • Pools and queues overflow. Connection pools, worker pools and queues have fixed sizes. A spike fills them at once, and requests that cannot get a slot wait or fail.
  • Protection kicks in. Firewalls, bot protection and rate limits can treat a genuine rush of customers as an attack and block them.
  • Third parties have their own limits. Payment, search and stock services may limit how many requests they accept per second from one shop.

What a spike test answers

  1. Does the site survive the jump? Pages keep loading and errors stay low while the users arrive.
  2. How long does it take to settle? Response times often rise sharply for a minute and then come down as caches warm and capacity is added.
  3. Does it recover? After the spike, response times and resources return to normal. A site that stays slow after the rush has a problem that will hurt the next spike too.

Typical spikes

Event Shape of the traffic
Ticket sale or product drop at a set time A wall of users at the second it opens, then a slow decline
Newsletter or push notification A steep rise in the first minutes, most of it within an hour
TV advertisement or influencer post A spike within minutes of airing, often several in one evening
Black Friday opening A spike at midnight or opening time, then a long high plateau: test with a spike and a soak test

How to design a spike test

  1. Start from a baseline. Run a few users for a few minutes so you have normal response times to compare with.
  2. Jump. Add the spike, for example from 10 to 300 users within a minute. Size it from the event: the number of people you expect in the first minutes, not over the whole day.
  3. Hold. Keep the load for long enough to see whether response times settle, usually 5 to 15 minutes.
  4. Drop. Return to the baseline and watch the recovery.
  5. Repeat with a bigger spike if the first one passes, until you find where the site stops coping.

Watch the error rate and a percentile such as p95 minute by minute. The average alone hides the users who waited 20 seconds while caches filled.

What usually helps

  • Warm the caches before the event opens, for example by loading the key pages just before.
  • Scale up in advance rather than relying on autoscaling to react, when you know the time of the spike.
  • Make the first page cheap: the landing page of a ticket sale should not run expensive queries.
  • Allow the traffic in your firewall and bot rules, and tell your hosting provider about the event.
  • A virtual waiting room that admits users at the rate the site can take is the last resort when demand will always exceed capacity.

With Supervisor

An automatic test adds users gradually: it starts with 4 users and adds more every 10 seconds, which is the right shape for finding the limit but not for a spike. For a spike, use a controlled test: you add users step by step yourself, so you decide how big each step is and when it comes, watch the live browsers while it runs, and see each step’s effect on page loads. Supervisor’s browsers are real browsers, so a spike test also shows what the browser sees: pages that stay blank because a script failed under load, not only server response codes.

For an event with thousands of simultaneous buyers, a managed load test prepares the capacity and our performance engineer runs the spike with you.