Skip to content
FunnelGuard

Fix guide by FunnelsGuard

TTFB spikes at certain times: how to find and fix them

PRF-051Medium impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

TTFB is the time between a browser asking for a page and receiving the first byte of the reply. On a healthy site it is steady. With this issue it is usually fine, then jumps for a few minutes or an hour, then recovers.

The pattern often repeats. Common causes are scheduled tasks (WordPress wp-cron, server cron jobs, product feed imports), backups that compress files and dump the database, search engine or bot crawls, email or ad campaign sends that bring a burst of visitors, and shared hosting neighbours using the same resources.

Why it costs you leads or sales

Visitors who arrive during a spike wait longer before anything appears. Some leave, and some forms or checkout requests time out. The worst part is that spikes often line up with your best traffic: a newsletter send, a morning ad budget burst or a sale launch.

TTFB across a day with a nightly backup and a morning campaignExample numbers
TTFB across a day with a nightly backup and a morning campaign (example)00:00: 320 ms; 02:00 backup: 2,400 ms; 06:00: 340 ms; 09:00 campaign: 1,900 ms; 12:00: 380 ms; 18:00: 360 ms09201,8403202,4003401,90038036000:0002:00 backup06:0009:00 campaign12:0018:00ms

Example: illustrative TTFB readings. Normal hours are steady, but the 02:00 backup and 09:00 campaign peak spike.

How to check if your site has it

Find the spike pattern
  1. Collect TTFB over time

    One test is not enough. You need repeated measurements across at least a few days, ideally spread over all hours. Uptime or synthetic monitoring tools can do this, as can a scheduled script.

  2. Note the times of the spikes

    Write down the hour and weekday of each slow reading. Check whether they repeat daily, weekly or only on campaign days.

  3. List what runs at those times

    Check backup plugin or host backup schedules, server crontab (crontab -l), WordPress scheduled actions, imports and email sends. Also check your analytics for traffic peaks at the same hours.

  4. Look at server load

    In your host control panel, look at CPU, memory and PHP worker graphs for the spike window. A flat line at the limit during a spike points to resource exhaustion.

  5. Check the server logs

    Look for slow requests, 5xx errors and a burst of requests from one IP range or user agent at the spike time.

Measure TTFB from the command linebash
curl -o /dev/null -s -w 'TTFB: %{time_starttransfer}s
' https://www.example.com/

# Log it every 5 minutes to a file (add via crontab -e)
*/5 * * * * curl -o /dev/null -s -w "$(date -Is) %{time_starttransfer}\n" https://www.example.com/ >> /var/log/ttfb.log

How to fix it

How a spike reaches your visitor
  1. Visitor clicks adRequest sent to your server
  2. Server busyBackup or cron job uses CPU and database
  3. Slow first bytePage starts after seconds, not milliseconds
  4. Visitor leaves or form times outLead or sale lost

A heavy job competes with visitors for the same server, so the page request waits.

Fix the cause of the spikes
  1. Move heavy jobs off-peak

    Reschedule backups, imports and reports to the hours with the least traffic for your audience. Do not stack several jobs at the same minute.

  2. Throttle or lighten the job

    Use incremental backups instead of full ones, exclude cache and log folders, and lower backup compression or process priority where your tool allows it.

  3. Serve pages from a full-page cache

    Cached pages do not need PHP or the database, so a busy server hurts them far less. Landing pages should be cached.

  4. Add a CDN in front of the site

    A CDN can answer cached pages itself, so peaks and background jobs on your origin server matter less to visitors.

  5. Add capacity if peaks are real traffic

    If spikes match campaign sends, raise PHP workers or move to a larger plan, and warn your host before big sends.

  6. Block or limit abusive bots

    If logs show a crawler flood at spike times, use your host or CDN rate limiting. Do not block legitimate search engines or your own monitoring.

Platform-specific actions
  1. Replace wp-cron with a real cron job

    By default WordPress runs scheduled tasks when a visitor loads a page, which can slow that visit. Add define('DISABLE_WP_CRON', true); to wp-config.php, then have the server call wp-cron.php on a schedule.

  2. Reschedule backup plugin runs

    In your backup plugin settings (for example UpdraftPlus under Settings > Backups), set the schedule to a quiet hour and split files and database into separate runs.

  3. Check scheduled actions

    If you use WooCommerce or Action Scheduler, look under Tools > Scheduled Actions for large pending queues running at peak times.

  4. Turn on page caching

    Enable full-page caching in your cache plugin or host panel and confirm landing pages are not excluded.

Run a backup at low priority at a quiet hourbash
# crontab -e: 03:30 every night, low CPU and disk priority
30 3 * * * nice -n 19 ionice -c3 /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1
WordPress: trigger wp-cron from the server every 5 minutesbash
# 1) In wp-config.php add:  define('DISABLE_WP_CRON', true);
# 2) Then in crontab -e:
*/5 * * * * curl -s https://www.example.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1

How to confirm it's fixed

Confirmation checklist
  • Run measurements through the old spike window and compare with earlier days.
  • TTFB stays close to its normal level during backups and cron runs.
  • Server CPU and PHP worker graphs no longer hit their limit at that time.
  • Landing pages return cache hits (check headers such as x-cache, cf-cache-status or your plugin's header).
  • No 5xx errors or timeouts appear in logs during the window.
  • A test form submission at the old spike time completes quickly.
Before and after rescheduling and caching

Before

  • Backup runs at 09:00 during the campaign peak
  • wp-cron fires on visitor page loads
  • Landing pages built by PHP on every request
  • TTFB jumps for an hour, then recovers

After

  • Backup runs at 03:30 at low priority
  • Server cron runs tasks on a fixed schedule
  • Landing pages served from cache
  • TTFB stays steady through the day

How to prevent it happening again

Prevention habits
  • Keep a simple schedule list of every backup, import and cron job.
  • Tell your host and team before big email sends or ad budget increases.
  • Stagger new jobs instead of using the top of the hour.
  • Review hosting resource graphs monthly and after adding plugins.
  • Monitor TTFB over time, not just in one-off speed tests.
  • Re-check after plugin, theme or host changes.

How FunnelGuard handles this

FunnelGuard detects this issue today. Its robot visitor runs your journeys on a schedule and records the server response time on each run. The check compares the latest run with your last 30 runs and flags an anomaly when the response time is well out of line with that recent pattern.

A failure is re-checked from a second region before one alert goes out, so a one-off blip in one location is less likely to wake you. The alert includes a screenshot and a likely cause. It tells you that a spike happened and when; you still need to match it to your cron jobs, backups or traffic using the steps above. How many spikes you can catch depends on how often your checks run: the Free plan checks daily, so short spikes can fall between runs.

Common spike sources and where to look
Likely causeTypical patternWhere to look
Backup jobSame time every day or weekBackup plugin or host schedule, crontab
WordPress cronRandom slow visits, scheduled tasks pile upwp-config.php, Scheduled Actions
Campaign or email sendSpike right after a sendEmail platform schedule, analytics
Bot crawlBurst of requests from one rangeAccess logs, CDN or WAF dashboard
Shared host neighboursIrregular, no match to your jobsHost resource graphs, support ticket

Questions people ask

Why is my website slow at the same time every day?

A scheduled job is the most likely cause. Daily backups, cron tasks, imports or a regular email send can use the CPU and database at that hour. Match the slow times to your backup schedule, crontab and traffic graphs.

Can a backup slow down my website?

Yes. Backups compress files and dump the database, which uses CPU, memory and disk. On shared or small servers this delays page responses. Schedule backups for quiet hours, use incremental backups and run them at low priority.

Does wp-cron cause slow TTFB in WordPress?

It can. By default WordPress runs scheduled tasks when a visitor loads a page, so that visit may wait. Setting DISABLE_WP_CRON to true and running wp-cron.php from a real server cron job moves that work away from visitors.

How do I find out what causes TTFB spikes?

Record TTFB repeatedly over several days, note the times of the slow readings, then compare them with backup schedules, cron jobs, server load graphs and traffic. Logs for the spike window often show the culprit.

Will a CDN fix TTFB spikes?

It helps if the spiking pages can be cached, because the CDN answers without touching your busy origin server. It will not fix uncached requests such as carts, logins or form submissions, so you still need to fix the underlying job.

How can I tell if traffic peaks are slowing my site?

Compare slow periods with your analytics and server graphs. If TTFB rises as visits rise and CPU or PHP workers reach their limit, the server lacks capacity. Add caching first, then more resources if needed.

Can FunnelGuard tell me when my TTFB spikes?

Yes. FunnelGuard compares each run's response time with your last 30 runs and flags an anomaly, then re-checks from a second region before alerting. It shows when the spike happened, so you can match it to a job or peak.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: anomaly vs last 30 runs.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.