Increasing Cron event concurrency on VIP Go

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 whitelist 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, e.g. less than 5, then it is not worth increasing concurrency.

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;
} );

If you have any doubts or questions, please send us a support ticket and we’ll be happy to help.

Ready to get started?

Drop us a note.

No matter where you are in the planning process, we’re happy to help, and we’re actual humans here on the other side of the form. 👋 We’re here to discuss your challenges and plans, evaluate your existing resources or a potential partner, or even make some initial recommendations. And, of course, we’re here to help any time you’re in the market for some robust WordPress awesomeness.