Too many failed or pending actions in Action Scheduler table
WP Rocket uses Action Scheduler for Preload and Remove Unused CSS, so you will see these hooks in the wp_action_scheduler table:
- Remove Unused CSS
rocket_rucss_job_check_status
rocket_rucss_pending_jobs_cron
- Preload
rocket_preload_job_preload_url
rocket_preload_job_check_finished
- this checks if the preload job that is in progress has finished and it is scheduled to run every 1 minute. Don’t be alarmed if you see many of these with the “complete” status - that means it’s working correctly.
If you see too many pending or failed actions related to the above, follow these steps:
- Make sure cron is running regularly. Both features depend on cron and if it’s not running often enough, the actions will stack up.
You can do this by using the WP-Cron Status Checker plugin, as described here: Check WP Cron with a plugin - Set up a real cron job to call wp-cron.php regularly as described here:
Setting up a cron job on the server
If you already have a cron job set up, you may need to increase the frequency.
For example, a 15 minute interval may be too long. We recommend 1 or 5 minutes. - After setting up the cron, restart Preload or Clear the Used CSS from the top menu options?.
- If the problem continues and the action_scheduler table continues to get bloated, you can directly remove the related actions from the database.
❗️Do not run this yourself unless you know what you are doing! You should ask your host to do this for you, to avoid errors. Create a database backup before any action is taken❗️
- Find the instructions for Remove Unused CSS related actions here:
https://docs.wp-rocket.me/article/1627-database-size-increases-with-remove-unused-css#action-scheduler-actions-and-logs-tables - To remove Preload actions, use the following MySQL query:
DELETE FROM `wp_actionscheduler_actions` WHERE `hook` = 'rocket_preload_job_preload_url' LIMIT 100;
Please note:
- In your case, the database prefix may be different from
wp_
, so you may need to replace it. - You can increase the
LIMIT 100
value toLIMIT 500
orLIMIT 1000
, gradually, making sure the query doesn't crash the database server.
- Find the instructions for Remove Unused CSS related actions here: