Handling webshop peak load: measure first, scale later
The morning after your sale, someone on your team puts two overviews side by side: the payments at the payment provider and the orders in the back office. They don't match. Some orders arrived much later because an API got stuck, a few appear twice, and for some customers the payment went through while the order is nowhere to be found. Handling webshop peak load covers the entire customer journey, from the first page view to stock check, payment and order confirmation. If one link fails, it costs you revenue and trust.
Much of that rush is visible in advance. Black Friday, product launches, seasonal promotions and campaigns are in the calendar ahead of time. Even so, many webshops only get tested once visitors are already in the checkout. At LJPc we follow this order: measure first, then optimise and protect the checkout, and only after that buy extra capacity.
The weak spot is often in the chain
When a peak is coming, many business owners think of CPU, memory and bandwidth first. Those count, and behind them sits a chain of components that can slow each other down under pressure: caching, database queries, the search function, integrations with ERP or PIM, the payment provider, shipping software and email services.
A product page can keep loading nicely while the stock integration gets slower with every item added to a basket. The customer is left wondering whether the order went through, and the next morning your team is working out which orders were processed once, not at all or twice.
When you estimate capacity, look at concurrent users, transactions per minute, the number of database operations and the load on external systems. A hundred visitors calmly browsing ask something very different of your webshop than a hundred visitors checking out a product with limited stock at the same moment.
Handling webshop peak load starts with a baseline
Without current measurements, scalability remains an assumption. So well before the campaign, measure how fast key pages load, how long the checkout steps take and which processes use the most server capacity. Put the outliers in response time next to the average; that is where you see where a customer gets stuck when it is busy.
A useful baseline includes at least:
- the load time of category and product pages
- the speed of the search function
- the time it takes to complete the checkout
- the processing of an order in the connected systems
- error messages and timeouts
That last point carries weight. A system that is fast on average and occasionally returns an error under load is one you cannot rely on during a campaign.
Measure the front end and the back end of the webshop separately. Behind the product pages, other work keeps running: updating stock, checking prices, saving orders and driving integrations. If everything runs on the same limited capacity, a busy homepage can slow down your order processing.
Test what happens when an integration stalls
Run a load test that resembles your expected campaign: visitors searching, using filters, adding products to their basket and checking out at the same time.
Then test the moments where things are allowed to go wrong. Make the payment provider respond more slowly and see whether the checkout holds up. Make the ERP temporarily unreachable and check that the order is stored safely. And let a product sell out during checkout, to see which message the customer gets. During a peak, these are exactly the situations your support team would otherwise have to sort out by hand.
Optimise first, then scale up
If a webshop has slow database queries, extra servers will not fix the cause. That is why we optimise first and then scale up to fit. That usually gives you more speed for less money.
Which kind of scaling fits depends on your traffic pattern. If you have a few predictable sale moments a year, scaling up temporarily makes sense. If traffic grows structurally, the base infrastructure has to grow with it. Permanently buying far too much for a handful of busy days is a waste of money.
In a straightforward environment we would start with vertical scaling. The server temporarily gets more processing power, memory or faster storage, and that is often quick to arrange. Spreading traffic over several systems gives more headroom and better continuity. It requires an application that is set up for it, with sessions, files, caching and database connections that are not needlessly tied to one server.
Take repeated work off server and database
Many visitors look at the same banners, categories and product information. Put those parts in a good cache. They then reach the visitor faster, and you keep processing power free for what differs per customer, such as baskets and checkouts.
A content delivery network serves static files such as images, scripts and stylesheets closer to the visitor, which takes load off the main server. Take a critical look at your product photos while you are at it. Good photos sell. Keep the files light, because a needlessly heavy file slows down mobile visitors and adds load while the campaign is running.
During a peak, weak spots in the database get magnified: slow queries, redundant product attributes, badly configured filters and extensions that fetch extra data on every page view. Find out which queries run most often and which take longest. Sometimes the gain is in a missing index or cache, sometimes in an integration or custom feature that was built too inefficiently.
Every plugin is a dependency
Plugins, tag manager scripts, review tools and personalisation services add functionality and bring dependencies with them. Go through them one by one before your sale and decide for each whether it contributes to conversion or mostly adds weight.
Set up error handling so that a non-critical external service can drop out temporarily during a peak and the customer can still complete the order. Critical integrations such as payment and stock need monitoring, clear timeouts and a recovery process.
Protect the checkout and the last item
The checkout is where you earn your money. Limit everything there that is not needed to pay. Unnecessary scripts and live product recommendations can live on other pages, and complex checks deserve extra restraint in the checkout.
Stock is just as sensitive. With scarce products you want to prevent several customers from buying the same last item. That takes clear stock reservation and well-aligned processes between the webshop and the stock system. If synchronisation lags behind, it can lead to backorders, disappointed customers and extra work for customer service.
Be honest, too, when delivery takes longer or stock is limited. A clear notice on the product page sets the right expectation before the customer pays. Align technology and customer communication so you handle exceptions during a peak in a controlled way.
Agree in advance who may step in
During a sale it should already be clear who has access to the hosting, which party maintains the application and who is allowed to fix a database error. Fragmented responsibilities slow down recovery exactly when every minute counts.
Set up active monitoring for availability, error rates, server load, database performance and the most important transactions. Have the monitoring walk through the critical customer paths as well, from product page to checkout, so you are alerted as soon as customers get stuck.
Agree who decides on scaling up, who assesses incidents and how you keep the rest of your organisation informed. At LJPc, development and hosting come together in one technical point of contact. That lets us assess cause and solution together, with the code and the server in one picture.
Scale back only when the orders add up
After a successful sale, traffic usually drops off again. Before you reduce capacity, check that all orders have been processed, payments are linked to the right orders, stock levels are correct and the queues in external systems are empty.
Then use the campaign as a source of facts. Write down which pages were under pressure, which integration was slow and where visitors left the checkout. That data makes the next peak cheaper, calmer and easier to predict.
If there is a sale in your calendar, pull up the figures from your last busy day this week. Put that day's payments next to the orders and find out whether and where they drifted apart. That is where your baseline starts.