Skip to content

Action Scheduler and Cron

webdesign29 edited this page Jun 13, 2026 · 1 revision

Action Scheduler & Cron

The problem

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.

What the Cron module does

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:
  • 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_expected filter.

Recommended host setup

// 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

Verifying

  • DashboardAction Scheduler & cron: "Async loopback runner: disabled (system cron)", plus pending/running/failed/completed counts and the oldest overdue action.
  • wp bext doctor reports the async-runner status.
  • After enabling, watch your access log: the long admin-ajax.php?action=as_async_request_queue_runner entries should disappear.

Clone this wiki locally