Increasing Cron event concurrency on VIP Go

Overview #

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.

↑ Top ↑

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.

↑ Top ↑

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?

Tell us about your needs

Let us lead the way. We’ll help you select a top tier development partner. We’ll train your developers, operations, infrastructure, and editorial teams. We’ll coarchitect your deployment processes. We will provide live support for peak events. We’ll help your people avoid dark alleys and blind corners, and reduce wasted cycles.