Skip to content

Backgrounds

How-to Guides

Technical References

Tools for Site Management /

Cron control

Scheduled jobs on VIP Go use the WP Cron API provided by WordPress core. The cron jobs are initiated and regulated via the WP Cron Control plugin, and you can read more in our article on our VIP Cron infrastructure.

By default, Cron Control will only run one event of a given type (i.e. with the same action) at any one time. This is designed to avoid issues where multiple events simultaneously write to the same values in the database, particularly in alloptions, causing issues with data loss.

In some circumstances, multiple events with the same action can safely run in parallel. This document explains how to permit these events and specify the concurrency for them.

When to increase concurrency for a Cron event

If you are expecting only low numbers of your Cron event at any one time, i.e. less than 5, then it is not worth increasing concurrency.

Caution

If your event writes data to an option which is autoloaded, it is not safe for increased concurrency.

How to increase Cron event concurrency

To specify the concurrency level for an event, filter the a8c_cron_control_concurrent_event_whitelist hook, adding the event to the array using the action name as the key and an integer representing the number of simultaneous events of that action which you want to run. Here is an example:

/*
 * Increase Cron Control's concurrency limit for my_async_send_ping action to 10
 */
add_filter( 'a8c_cron_control_concurrent_event_whitelist', function( $wl ) {
    $wl['my_async_send_ping'] = 10;
    return $wl;
} );

Last updated: August 10, 2021