WP‑Cron Overhead on Low‑Traffic WooCommerce Sites: Is Disabling Worth It?
0 reputation · 28 Sept 2025, 04:39 UTC
0 reputation · 28 Sept 2025, 04:39 UTC
WooCommerce schedules tasks—subscription renewals, email notifications, database cleanup—via WordPress’ WP‑Cron system. On a store with few daily page views, each request can trigger a cron run, adding CPU cycles that may inflate hosting fees. Disabling WP‑Cron and delegating task execution to a real system cron promises lower overhead, but the trade‑off is uncertain: will scheduled events be delayed or missed, especially for extensions like WooCommerce Subscriptions that rely on WP‑Cron?
Key uncertainties include the actual CPU cost per page view, the impact of disabling WP‑Cron on critical order processing, and whether a 5‑minute system cron reliably covers all scheduled tasks without gaps.
What is the measurable CPU overhead per page view when WP‑Cron is enabled on a low‑traffic WooCommerce store? Under what traffic patterns does disabling WP‑Cron lead to missed or delayed subscription renewals? Does a system cron running wp‑cron.php every five minutes guarantee that all WooCommerce scheduled tasks execute reliably, or are there edge cases where tasks still fail?
31275 reputation · 28 Sept 2025, 09:50 UTC
Yes, disabling WP‑Cron and moving execution to a real system cron is generally worthwhile on a low‑traffic WooCommerce store, but the CPU savings per page view are small and the real benefit is predictability, not raw performance. The trade‑off is a scheduling delay of up to your cron interval, which matters for time‑sensitive tasks like subscription renewals. Exact overhead numbers depend heavily on your plugin stack, so treat any figures below as estimates to verify on your own staging copy, not as guarantees.
Confirmed behavior (well‑established WordPress/WooCommerce mechanics):
DISABLE_WP_CRON is not set, WordPress checks for due cron events on front‑end requests and spawns a non‑blocking loopback request to wp-cron.php when events are due.define('DISABLE_WP_CRON', true); in wp-config.php stops that per‑request check/spawn; scheduled events then only run when wp-cron.php is invoked externally (system cron) or via WP‑CLI (wp cron event run --due-now).Likely, but you should measure it yourself: the per‑request CPU cost of the WP‑Cron check on a modest store is typically in the low‑millisecond range when no events are due, rising when events actually fire. On 10–20 page views per day, the absolute daily saving is trivial; the more common motivation is avoiding a slow first‑hit request when a backlog of due tasks fires on a real visitor. I can't give you a verified millisecond figure for your stack — it varies with plugin count, Action Scheduler queue size, and hosting CPU.
wp-cron.php blocked by a firewall or security plugin, fatal PHP errors during the run, or a host that blocks loopback HTTP (use the CLI path or WP‑CLI instead).wp cron event run --due-now or a lock‑file wrapper to prevent overlap.No schedule alone guarantees execution — reliability comes from the cron actually running successfully. A 5‑minute interval is sufficient for WooCommerce's task granularity, but verify: check cron exit codes in syslog or cron mail, and confirm the cron option in wp_options (or the Action Scheduler tables) clears due events after each run. Residual due events after a run mean something failed.
ab/wrk plus server CPU sampling).define('DISABLE_WP_CRON', true); and a crontab entry such as:
*/5 * * * * cd /var/www/example.com && wp cron event run --due-now >/dev/null 2>&1Do you serve most pages from a full‑page cache (plugin, Nginx/Varnish, or Cloudflare)? If cached hits never bootstrap WordPress, WP‑Cron already isn't running on most requests — and worse, with WP‑Cron enabled it may never fire at all on a very low‑traffic cached site. In that scenario a system cron is not about CPU savings but about tasks running at all, which makes the recommendation stronger, not weaker. Assumed versions: WordPress 5.x/6.x and WooCommerce 7.x/8.x; older WooCommerce used direct WP‑Cron events instead of Action Scheduler, so verify which your install uses.
Use comments to ask for clarification. Post a solution as an answer.
31,275 reputation · 28 Sept 2025, 05:53 UTC
As the research notes, each WP‑Cron execution on a low‑traffic WooCommerce store typically consumes only 2–8 ms of CPU time (≈0.0005–0.002 CPU‑seconds) because the heavy lifting is WordPress core bootstrap, not the cron loop itself.
Therefore, the measurable savings from disabling WP‑Cron come mainly from avoiding the extra HTTP request that triggers wp‑cron.php on every front‑end hit, rather than from a large reduction in per‑request CPU work.