Site icon Karen Attfield

WP-Cron vs Spawned Background Jobs: How WordPress Really Runs “Background” Work

Robot pointing on a wall

If background work on your WordPress site appears to take longer than you’d expect, the issue may not necessarily be the task, but how WordPress runs it. WP-Cron and spawned background jobs solve similar problems, but they operate very differently, and those differences show up most clearly in tail latency and reliability. Tail latency refers to the slowest few percent of executions that users feel even when the average looks fine.

Understanding where your work runs—and what it’s queued behind—makes it easier to choose the right model.

How WP-Cron Works

Despite the name, WP-Cron is not a real system cron, which would schedule commands to run automatically at specified intervals. Instead, it’s a request-driven scheduler.

In practice, this means that WP-Cron jobs:

If the request that fires cron is an admin update, a maintenance-mode flow, a loopback check (when WordPress makes an HTTP request to itself), or something with sleeps, retries, or heavy I/O (Input / Output, for example database queries), then your “background” job politely waits its turn. That waiting time is invisible unless you measure it—but it shows up as high tail latency.

WP-Cron Pros

WP-Cron Cons

WP-Cron works best when tasks are tiny, idempotent (have an equal result), and non-urgent.

How Spawned Background Jobs Work

Spawned background jobs take a more explicit approach. Instead of running work inline, the parent request:

This can be done via:

The key difference here is isolation. Spawned jobs don’t inherit the parent request’s baggage. They also start fresh, with their own execution window, and aren’t queued behind admin screens, updates, or maintenance logic. Even if the code path is identical, removing that waiting time dramatically improves tail latency.

Spawned job pros

Spawned job cons

Spawned workers shine when tasks are heavier, bursty, or triggered by long-running parent requests.

What to Consider

If you want to understand where your time is really going, measure:

Often the surprise isn’t the “send” or “process” phase—it’s the work done before the job even starts running.

Practical Ways to Reduce Tail Latency

These apply to both models, but matter more for inline cron:

Final Thoughts

WP-Cron runs inside a request. Spawned background jobs run beside it. If your jobs feel slow, consider not only what work they do, but also where they run. Move heavier tasks to isolated spawned requests, reduce what you process, and coalesce where you can. You should immediately notice the performance improvement.

Exit mobile version