A traffic spike that turns a fast site slow — or briefly knocks it into 508s — is one of the most common cPanel incidents, and also one of the most misdiagnosed. The site was fine yesterday, traffic doubled (a newsletter, a sale, a link from a big account, or a bot swarm pretending to be traffic), and now pages crawl. The instinct is to “add resources”, but resources are plural: the spike pushed one of CPU, entry processes, PHP workers, or the database to its ceiling first, and everything downstream queued behind it. Relieving the wrong one does nothing. The job is to find the first bottleneck — the resource that actually saturated — and address that, while confirming the traffic is even real.
What’s happening
Under normal load, a request flows quickly through a chain: the web server accepts it, a PHP worker runs the code, the code queries MySQL, and the response goes back. Each stage has a finite capacity. When request volume rises, the chain stays fast until one stage hits its limit; from that moment, requests pile up behind that stage, and every later stage looks slow even though the real constraint is one specific link.
On a cPanel/CloudLinux host the usual first ceilings are: the CloudLinux EP limit (too many concurrent dynamic requests for the account), the PHP-FPM pool running out of workers (requests wait for a free child), the CPU/LVE limit if pages are computation-heavy, and MySQL if the extra traffic multiplies an already-expensive query. There is also the question that must be answered first: is the spike real users or a bot flood? A scraper or a small DDoS produces the same saturation as a legitimate surge, but the response is opposite — you block bots, you do not provision for them. The diagnosis is to look at where requests are queuing right now and to check the access log for whether the “traffic” is human.
How to verify
First, is the spike real traffic or a bot? The access log answers this fast:
# Top client IPs in the last burst — a few IPs dominating = likely a bot/scraper
tail -2000 /home/cpuser/access-logs/$(ls /home/cpuser/access-logs/ | head -1) \
| awk '{print $1}' | sort | uniq -c | sort -rn | head
# Top URLs and user-agents
tail -2000 /home/cpuser/access-logs/$(ls /home/cpuser/access-logs/ | head -1) | awk '{print $7}' | sort | uniq -c | sort -rn | head
Then find which stage is saturating. Check CloudLinux limits, PHP workers, and the database together:
# Is the account hitting EP/CPU faults? (per-account ceiling)
lveinfo --user=cpuser --period=1h --display-username
# PHP-FPM: are all workers busy and is a queue building?
grep -E 'listen queue|active processes|max children' /opt/cpanel/ea-php*/root/usr/var/log/php-fpm/error.log 2>/dev/null | tail
# MySQL: are queries backing up under the new load?
mysql -e "SELECT command,COUNT(*) FROM information_schema.processlist GROUP BY command;"
Look at overall server state to see if it is the whole box or one account:
# Load average and what is consuming CPU
uptime; top -bn1 | head -12
# Apache/LiteSpeed busy workers vs the limit
/usr/local/cpanel/scripts/restartsrv_httpd --status 2>/dev/null; ps -C lsphp,httpd --no-headers | wc -l
The fix
- Confirm the traffic is human before provisioning — the IP/user-agent breakdown tells you whether real visitors arrived or one scraper is hammering you. If a handful of IPs or a single user-agent dominates, block or rate-limit them at CSF/
.htaccessand the “spike” disappears. Provisioning for a bot just gives the bot more room; rule this out first. - Cache aggressively to take load off every stage at once — the fastest relief for a genuine surge is full-page caching, because a cached response skips PHP and MySQL entirely. For WordPress, enable LiteSpeed Cache (LiteSpeed host) or a page cache so the bulk of the spike is served from cache. This simultaneously relieves EP, PHP workers, CPU, and the database — it is the one fix that helps no matter which stage saturated.
- Relieve the EP ceiling if that is the wall — if
lveinfoshows EP faults, the account is hitting concurrency. Caching (step 2) usually clears it; if the audience is genuinely large and sustained, raise the EP limit in WHM » CloudLinux LVE Manager. EP is the most common first ceiling for an uncached WordPress site under a spike. - Add PHP-FPM workers if requests queue for a free child — if the FPM log shows the listen queue building or “max children reached”, requests are waiting for a worker. Raise
pm.max_childrenfor the pool to match available memory (each worker costs RAM, so size it against the account’s PMEM/the server’s free memory). A pool sized for normal traffic will bottleneck under a spike even when CPU is idle. - Fix the query the spike amplified — a query that is merely slow at normal traffic becomes a server-wide problem when the spike multiplies it. If PROCESSLIST shows the same statement piling up, that query needs an index or caching. The spike did not create the slow query; it exposed it. Address it so the next spike does not reproduce the incident.
- Shed load gracefully rather than letting it 508 — if the surge genuinely exceeds capacity for a short window, it is better to serve a lightweight cached or static version than to let every request 508. A maintenance/cache page, a CDN absorbing static assets, or temporarily disabling the heaviest non-essential feature keeps the site usable through the peak instead of collapsing.
- Right-size for the new baseline if the spike is the new normal — a one-off event passes; a permanent traffic increase means the account genuinely outgrew its allocation. Once the incident is over, decide whether this is a recurring level, and if so raise the specific limit that saturated (EP, PHP workers, CPU) or move the account to a larger package. Confirm by replaying the load or watching the next peak with
lveinfo— the saturation should not recur.
Every spike incident has one first bottleneck, and the whole skill is finding it instead of guessing: confirm the traffic is real, cache to relieve all stages, then widen the specific link that saturated. Stack Harbor handles traffic-spike triage and capacity planning under cPanel server management — start a conversation when a surge keeps taking the site down.