Black Friday, Cyber Monday and the pre-Christmas campaigns are when traffic to an online store can climb far above its normal level within minutes. A newsletter sent to the whole mailing list or an advert scheduled for a fixed hour is enough to set it off.

The homepage rarely fails under that load. Trouble usually starts in the cart and checkout, in search, in the database or where the store talks to the payment gateway. Each of these has a limit, and the time to find it is several weeks before the campaign. On the day itself, all that is left is reacting.

For the Magento, PrestaShop and WooCommerce stores we look after, preparation follows a fixed plan. Below we describe it in the order the work happens, from data analysis four weeks out to the review once the campaign is over.

Timeline of preparing a store for Black Friday: four weeks before, two weeks before, one week before, the day before, peak day and after the campaign
Stages of preparing a store for a traffic peak, from data analysis and load testing to the review after the campaign ends.

Four weeks before: campaign calendar, forecast and load test

The first conversation is about dates and times. Together with you and the people running marketing, we confirm when the promotion starts, when newsletters and push notifications go out, when ads go live and whether discounts switch on at midnight or in the morning. The send time of a newsletter to the full list affects the on-call plan more than the Black Friday date itself.

Next comes the data. We compare traffic from previous seasons with current trends: sessions and orders by hour, the share of mobile traffic, the most visited paths and the most frequent search queries. The sources are the store's analytics and the server logs. If the store has no history from last year, we work from the campaign plans and data from recent weeks.

From this we build a forecast of the requests per second and concurrent checkout sessions to expect in the busiest hour. We set the forecast against the current capacity of the environment and plan when, and by how much, to increase it.

Chart of forecast traffic and server capacity in the weeks before Black Friday, with capacity raised in steps ahead of the peak
Traffic forecast based on previous seasons, with environment capacity raised in steps to leave headroom before peak day.

Load testing the checkout

A forecast remains an assumption until it has been measured, so we run a load test before the season. The scenarios follow real customer behaviour from analytics: browsing a category, searching, opening a product page, adding to cart and going through checkout up to the redirect to the payment gateway. Payments run in the provider's test mode or against a stub, so the test creates no real transactions.

The test shows the traffic level at which response times start to rise and identifies the first bottleneck: the number of PHP-FPM workers, the database, Redis, the search engine or an external API. Decisions about resources are based on that result. Our approach is described on the load testing page.

External dependencies

On peak day, a store depends on more than its own servers. We list the external services involved: the payment gateway, courier integrations, ERP or PIM, hosted search and marketing scripts loaded in the browser. For each one we check API rate limits, the configured timeouts and how the store behaves when the service responds slowly or not at all. A slow external API can tie up PHP workers just as effectively as heavy traffic.

Two weeks before: resources, cache, database and bot traffic

More resources and higher limits

Based on the test results, we add capacity. Depending on the architecture, that means more CPU and memory for existing machines, extra application nodes behind the load balancer or a larger database instance. In the cloud we check account quotas and instance type availability in the region well before campaign day.

Limits go up together with resources: the number of PHP-FPM workers, the maximum connections for MySQL or MariaDB, nginx worker connections and open file limits. These settings depend on each other. More PHP workers mean more database connections and higher memory use, so we change them in steps and repeat the test after each change.

Cache

During a promotion, most traffic lands on category pages, product pages and campaign landing pages. Those pages should be served from a full-page cache (on Magento usually Varnish), with static files delivered through a CDN. We check what share of requests the cache serves and what invalidates it. A common issue is a price or stock import running every few minutes that flushes the entire cache rather than the entries for the products that changed. We configure such imports to refresh only changed data, or move them outside peak hours. Sessions and the application cache are kept in Redis, with memory sized to the forecast.

Database

We review the slow query log from recent weeks and from the load test. Missing indexes and queries generated by extensions are a frequent source of problems that go unnoticed at normal traffic levels. Where the application supports it, reports and exports are sent to a read replica or moved to the night.

Queues and cron jobs

Indexing, product feeds for price comparison sites, email sending and data clean-up all run in the background and consume resources too. We move the heavier jobs outside campaign windows and check that queue consumers keep up with order processing. Queue length is added to monitoring.

Bot traffic

Automated traffic grows during promotions: price scrapers, bots trying stolen passwords on the login page and aggressive crawlers. Every such request uses the same PHP workers and database connections as a real customer. At the network edge, most often in Cloudflare, we set up WAF rules and rate limits for login, search, cart and API endpoints. Requests with a low bot score get an additional challenge. Exceptions cover search engine crawlers and payment gateway notifications, because a blocked webhook means orders without a confirmed payment. There is more on this in our article on malicious bots in online stores.

One week before: change freeze, backups and the runbook

A change freeze applies from the agreed date. No new features are deployed, extensions and the theme are not updated, and configuration changes only when necessary. Security fixes and bugs that block sales are the exception, and they still go through an agreed approval path. We set the freeze rules in advance with your development team or agency.

Before the freeze we take a full backup of the database and files, then test the restore in a staging environment. That backup becomes the reference point if a change has to be rolled back during the season.

Alert thresholds tuned for normal traffic would either fire every few minutes on peak day or fail to react to a real problem. Before the campaign we set separate thresholds for the peak period: checkout response time, 5xx error rate, database connections relative to the limit, queue length, free disk space (logs grow faster at that time) and error responses from the payment gateway. Alerts go to the on-call administrator.

We write a runbook for the specific store. It holds the contact list: decision-makers on your side, marketing, developers, the hosting or cloud provider and the payment provider's support. It also sets out concrete actions: how to add an application node, how to tighten WAF rules, which features can be switched off to reduce load and who can approve that. We also agree the on-call rota so that it covers the campaign launch and the busiest hours.

The day before: confirming plans and final checks

The day before the campaign, we confirm launch times, the send schedule and the list of promoted products with marketing. A large newsletter can be sent in batches, which spreads the traffic over a longer period. We request the campaign pages and promoted product pages in advance so they are already cached when the first customers arrive.

Then we work through a checklist: the added resources are running, autoscaling settings are active, certificates are valid, disks have free space, the latest backup completed successfully, WAF rules are enabled and the cron schedule has been adjusted. Finally, we place a test order through the full path, including payment if you agree to it on your side.

Peak day: on-call cover, monitoring and logs

The on-call administrator starts watching the store before the campaign goes live. A single dashboard shows requests per second, response time, CPU and memory usage, database connections, queue length and the number of requests blocked at the network edge. Current values are compared with the forecast and the load test results.

On-call monitoring dashboard: requests per second, response time, CPU usage, database connections and blocked bot requests
The dashboard the administrator watches on peak day. Current values are compared with the forecast and the limits found during load testing.

If traffic exceeds the forecast or a metric approaches a limit found during testing, we follow the runbook: add a node, raise a limit or tighten the rules for automated traffic. Changes outside the runbook are the exception and need a decision from the person named in the contact list.

At the same time we review the logs. We look for error responses from the payment gateway, timeouts on calls to external APIs, PHP errors and unusual patterns: single addresses or networks hitting search hundreds of times, login attempts across many accounts and scans of admin panel paths. Based on what we find, we add WAF rules during the day.

We keep in touch with you through one agreed channel, with short updates on the state of the store and on every decision that affects how it works, such as switching off a heavy recommendation module.

After the peak: review, scaling down and costs

Extra resources stay in place until the promotion ends, usually after Cyber Monday. We then scale down in steps and check the metrics after each one, so that capacity is not removed too early.

In the review we compare actual traffic with the forecast and record where bottlenecks appeared, which alerts were useful and which were only noise, how bot traffic behaved and which on-call tasks took the most time. The conclusions go into the plan for next season.

We also look at costs. We total the cost of the extra resources over the campaign period and look for anything left behind after the peak: additional nodes, larger database instances, snapshots and disks. Finally, we lift the change freeze and deploy the postponed changes in an agreed order.

What to prepare before the season

If you want to get your store ready for the next peak, start by gathering a few things:

  • the campaign calendar with launch and send times
  • access to analytics and data from previous seasons
  • a list of external integrations and contacts for their providers
  • the schedule of price and stock imports
  • contact details for the team that develops the store

We carry out this preparation for the stores we support as part of our e-commerce infrastructure service. Tell us about your environment and campaign plans, and we will propose a scope of work that fits your timeline.