In short
When a website crashes under high traffic, the cause is almost always a single bottleneck: PHP processes exhausted by uncached pages, slow database queries, or your plan's resource limits. Find the bottleneck first with logs and resource graphs. Then prepare at least a week before the sale with full-page caching, static asset optimization, load testing and, if needed, a move to a more powerful plan.
In this guide
- Why do websites crash during traffic spikes?
- From symptom to bottleneck: quick diagnosis table
- Finding the bottleneck: step-by-step diagnosis
- Pre-sale preparation checklist
- Load testing: how do you know you're ready?
- When caching isn't enough: time to scale your infrastructure
- What to do on sale day
- Next step
A site that won't load when your ad goes live, when your brand gets mentioned on TV, or on Black Friday morning is the most expensive kind of outage for a business: you lose visitors at the exact moment you have the most of them, and your ad budget goes to waste. The good news is that when a website crashes under high traffic, the cause is usually a single bottleneck you can find. This guide walks you through diagnosing that bottleneck and gives you a step-by-step checklist to work through before your campaign.
Why do websites crash during traffic spikes?
Every web request passes through a chain: the web server, the PHP processor, the database and the disk. On a normal day, every link in that chain has headroom. When visitor numbers multiply, the weakest link chokes and everything else waits on it. The most common bottlenecks are:
- PHP process (worker) limit: Every uncached page uses one PHP process. Once the number of concurrent processes is maxed out, new requests queue up and then fail with a 503 or 508 error.
- CPU: Heavy themes, lots of plugins and pages rebuilt on every request eat up the processor.
- Database: Unindexed queries, bloated tables (for example, autoloaded data in the WordPress
wp_optionstable) and the number of concurrent connections clog up fast under load. - Cache misses: Cart, logged-in user and search pages can't be served from cache. In e-commerce sales, most of the load comes from exactly these pages.
- External services: When a payment, shipping or inventory API slows down, PHP processes stay open while waiting for a response, and the limit fills up even faster.
- Bot and attack traffic: A sale announcement can also attract crawler bots and brute-force attempts, which consume resources meant for real visitors.
From symptom to bottleneck: quick diagnosis table
The error message is your strongest clue to where the bottleneck is. The table below shows where to look first.
| Symptom | Likely bottleneck | First fix |
|---|---|---|
| 508 Resource Limit Is Reached | Process, CPU or RAM limit on shared hosting | Check the resource usage graph and enable caching |
| 503 Service Unavailable | PHP processes maxed out or temporary overload | Identify uncached pages and bots |
| 502 / 504 Gateway error | Backend not responding or timing out | Review slow queries and external API calls |
| Error establishing a database connection | Connection limit or crashed MySQL/MariaDB | Enable the slow query log and count connections |
| Site loads but takes 10+ seconds | CPU maxed out or disk I/O wait | Profile heavy plugins and pages |
For a detailed breakdown of the 508 error, see 508 Resource Limit Is Reached: causes and a permanent fix.
Finding the bottleneck: step-by-step diagnosis
1. Review the logs from the time of the crash
The Errors and Raw Access sections in cPanel show which URLs were requested and which errors were generated when the site went down. If you have SSH access, you can list the most requested URLs in the access log with this command:
awk '{print $7}' ~/access-logs/ornek.com-ssl_log | sort | uniq -c | sort -rn | head -20If /wp-login.php, /xmlrpc.php or search pages are at the top of the list, the problem is uncacheable or malicious traffic rather than real visitors.
2. Check which IPs send the most requests
awk '{print $1}' ~/access-logs/ornek.com-ssl_log | sort | uniq -c | sort -rn | head -20A single IP making thousands of requests is a sign of a bot or an attack. Real campaign traffic is spread across many different IPs.
3. On a VDS, monitor resources in real time
On a server with root access, these commands pinpoint the bottleneck while the traffic is hitting:
top -o %CPU # processes using the most CPU
free -h # RAM and swap usage
iostat -x 2 # disk I/O wait (sysstat package)
mysqladmin processlist # queries running right nowIf swap usage keeps climbing, RAM is the bottleneck. If %iowait is high, it's the disk. If the same query sits in the MySQL process list for minutes, it's the database.
4. Enable the slow query log
On your own server, add the lines below to your MySQL or MariaDB configuration to log queries that take longer than 1 second:
[mysqld]
slow_query_log = 1
slow_query_log_file = /var/log/mysql/slow.log
long_query_time = 1The queries that repeat most often in this log usually point to a missing index or an inefficient plugin query.
Pre-sale preparation checklist
Work through this list at least a week before your campaign; changes made the day before can introduce new bugs.
- Enable full-page caching. On hosting that runs the LiteSpeed web server, the LiteSpeed Cache plugin serves pages without touching PHP at all, which greatly increases how many visitors the same hardware can handle. For settings, see Speed up WordPress with LiteSpeed Cache.
- Design the campaign page to be cache-friendly. The landing page your ad points to shouldn't have personalized content, a live stock counter or queries that run on every request.
- Optimize images. WebP format, correct sizing and lazy loading reduce both bandwidth and server load.
- Disable plugins you don't need. Analytics, social sharing and backup plugins you won't use during the sale shouldn't consume resources while traffic peaks.
- Move WP-Cron to a real cron job. The default WP-Cron fires on every page visit; disabling it and hooking it to the system cron removes unnecessary load under heavy traffic.
- Clean up the database. Old revisions, expired transients and abandoned cart records slow queries down.
- Prepare a backup and rollback plan. Take a full backup before the sale, and don't update plugins on the morning of the campaign.
- Limit bot traffic. Disable
xmlrpc.phpif you don't use it, and add a login attempt limit to the login page. - Run a load test. You can't know you're ready until you simulate the number of concurrent users you expect.
- Set up monitoring. An uptime monitor that checks your site every minute alerts you to problems before your customers notice.
Load testing: how do you know you're ready?
A load test sends a controlled number of virtual users to your site to measure the point at which it slows down. The open-source k6 tool is a practical option. A simple test script:
import http from 'k6/http';
import { sleep } from 'k6';
export const options = {
stages: [
{ duration: '2m', target: 50 },
{ duration: '5m', target: 200 },
{ duration: '2m', target: 0 },
],
};
export default function () {
http.get('https://ornek.com/kampanya/');
sleep(1);
}Run the test with k6 run test.js and look for the user count at which response time starts climbing sharply. Only load test your own site, ideally during off-peak hours; on shared hosting, it's a good idea to let the support team know before running a large test. Don't test just the landing page: run separate scenarios for steps that can't be cached, like product listings, search and add-to-cart. Your real limit usually shows up on those pages.
When caching isn't enough: time to scale your infrastructure
If, after all the optimization, your load test shows a limit below the traffic you expect, the problem is no longer software but resources. At this point you have three options:
- If you run a WooCommerce store: Because cart and checkout pages can't be cached, stores generate far more PHP and database load than business websites at the same traffic level. The e-commerce hosting plans, which come with WordPress and WooCommerce preinstalled via WP Toolkit, the LiteSpeed web server and NVMe storage, are built for this workload.
- If you want more resources without server management: Premium hosting keeps the ease of cPanel while offering 12-16 GB RAM, a 10-core processor and a 1000% CPU limit. It's the natural next step for sites that hit shared plan limits during sales. Access and error logs are included.
- If you need full control: For a Redis object cache, custom PHP-FPM settings or a separate database configuration, you need a server with root access. The AMD Ryzen 9 9950X VDS, with DDR5 memory, NVMe storage, KVM virtualization and multi-layer DDoS protection, cuts response times on PHP-heavy sites thanks to its high single-core performance.
To weigh which option fits you, see the comparison premium hosting vs. VDS for a high-traffic website.
What to do on sale day
- The day before, purge the cache and visit your landing pages once to warm it up.
- Don't update plugins, themes or the PHP version while the campaign is running.
- Keep the access log and your monitoring tool open; if 5xx errors suddenly spike, roll back the most recent change first.
- Ramp up your ad budget gradually; increasing traffic hour by hour instead of all at once gives the server time to adjust.
Next step
Start by finding the bottleneck on your current site using logs and resource graphs, then measure your limit with caching and a load test. If the measured limit is below your campaign target, upgrade your plan at least a few days before the sale so you have time for migration and testing. You can explore premium hosting plans or root-access Ryzen 9 9950X VDS options in Sunucu Atlas's Istanbul data center, and open a support ticket for help during the move.
Frequently asked questions
Why does my website crash when traffic spikes? Is the server too weak?
Not always. In most cases, uncached pages max out the PHP process limit or slow database queries clog the chain. Try caching and optimization first; if a load test still falls short, add more resources.
How far ahead of a sale should I prepare?
Start optimizing and load testing at least a week in advance. If you need a plan upgrade or migration, allow a few extra days for testing.
What's the difference between a 508 and a 503 error?
A 508 means the CPU, RAM or process limit assigned to your shared hosting account has been reached. A 503 is a more general error meaning the server can't handle the request right now, usually because PHP processes are maxed out.
Does LiteSpeed Cache really make a difference during sale traffic?
Yes. Cacheable pages are served without touching PHP or the database, so the same resources can handle far more visitors. However, cart, checkout and logged-in pages aren't cached, so an online store still needs enough resources for those pages.
Is premium hosting or a VDS better?
Premium hosting is the better fit if you want more resources with the ease of cPanel. A root-access VDS suits you better if you need full control, such as Redis or custom server settings. On a VDS, server management and security are your responsibility.