WordPress is a wonderful platform. It delivers on many levels, and has been a valuable part of our business stack for over a decade. It does however, have its limitations. WPcron is one of them.
What is cron?
“cron is a time-based job scheduler… People who set up and maintain software environments use cron to schedule jobs to run periodically at fixed times, dates, or intervals”
cron is a very reliable scheduling tool built into most of the web servers of the world. As software developers we’ve become very used to using cron, and a lot of the software you’ve used online uses it in some way or another to schedule/repeat tasks behind the scenes.
What is different about WordPress cron?
WordPress has it’s own built-in version of cron, but it differs in the way it operates.
cron runs at a low-level on the web server.
WordPress cron runs as a webpage via a file in your web server.
This means that cron has all of the reliability of modern web hosting, whereas WordPress is reliant on page views to your website to run.
So say you set a job to run every minute of the day. cron would reliably do this. WordPress cron would do this, when there is a website hit in that minute time-frame.
For high-trafficked websites, that might be fine (if you’re getting hits every minute of the day), but it does mean that these kind of jobs can hit your website performance. (And we all know that Google ranks us badly if we have bad performing websites!)
How will this affect my Jetpack CRM?
TL;DR; This won’t really affect most Jetpack CRM operations.
If you’re using Mail Campaigns v2+, or scheduled tasks (like System Emails Pro, Task Scheduler) – it may make these inaccurate or slow to send.
Most of Jetpack CRM has been written knowing about this WP cron bottleneck and working around it wherever possible. In some cases it’s simply not possible to get around the fact that WordPress cron can be unreliable/unperformant. For the following extensions, you’d be better off switching to server cron:
- Mail Campaigns v2+ – for sending more than 50 emails per campaign/hour
- System Emails Pro – for reliable email scheduling
- Task Scheduler – for reliable notification emails
How do I switch to server-cron?
Switching from ‘WordPress cron’ to Server-based cron is a great idea for most installs. If you’re on a reliable host it’ll take a load off of your front end (removing wp_cron need to fire on web visits), and it’ll far more reliably fire software functions like that in Jetpack CRM Mail Campaigns etc.
Click here to see the guide on switching to server-based-cron: