-
Notifications
You must be signed in to change notification settings - Fork 0
Action Scheduler and Cron
webdesign29 edited this page Jun 13, 2026
·
1 revision
Action Scheduler (bundled with WooCommerce and many plugins) runs
an async queue runner: on request shutdown it fires a loopback
POST wp-admin/admin-ajax.php?action=as_async_request_queue_runner. Behind bext these self-calls
were measured at 5–21 seconds, tying up PHP-FPM workers — often the single biggest source of
slow requests on a busy host.
When WP-cron is already driven by a system crontab (DISABLE_WP_CRON=true +
wp cron event run), the async runner is redundant and harmful.
When enabled (default) and the site is behind bext:
-
Disables the async loopback runner via
add_filter( 'action_scheduler_allow_async_request_runner', '__return_false' ). The queue still drains via the system cron. -
Bounds queue work so a cron-triggered run can't wedge a worker:
-
action_scheduler_queue_runner_concurrent_batches→1(filter:bext/as_concurrent_batches) -
action_scheduler_queue_runner_time_limit→min(20, …)s (filter:bext/as_time_limit)
-
-
Safety fallback: if no system cron appears to be running Action Scheduler (heuristic: WP-cron
is not disabled), it leaves the async runner enabled so the queue doesn't stall silently.
Override with the
bext/system_cron_expectedfilter.
// wp-config.php
define( 'DISABLE_WP_CRON', true );# crontab (per site) — every minute
* * * * * /usr/local/bin/wp --path=/path/to/public cron event run --due-now --quiet >/dev/null 2>&1- Dashboard → Action Scheduler & cron: "Async loopback runner: disabled (system cron)", plus pending/running/failed/completed counts and the oldest overdue action.
-
wp bext doctorreports the async-runner status. - After enabling, watch your access log: the long
admin-ajax.php?action=as_async_request_queue_runnerentries should disappear.
bext-wp · GPL-2.0-or-later · Sponsored by webdesign29 & Inklura · bext.dev
Getting started
Features
Reference
Operations