action_scheduler_run_queue add by WP Mail?
-
Hello guys how are you? so i using wp mail for years, and i suffer from something very wired.
usually after 24 hours i see the var/www/html/index.php go crazy on my SSH…
For years i was suspicius about action_scheduler_run_queue.
I don’t know 100% for sure if your plugin add this cron.
i need to know for sure because it run every minute…
Thanks guys,
Regards,
Levi
The page I need help with: [log in to see the link]
-
Hi @123nadav,
To confirm WP Mail SMTP does use the Action Scheduler library, so it does add the action_scheduler_run_queue cron hook to your site.
Here’s a bit of context on what it actually does:
Action Scheduler is a widely used background processing library, also used by WooCommerce, WPForms, All in One SEO, and many other popular plugins. By default, it hooks into WP-Cron and checks every minute to see if there are any scheduled tasks to run. The key thing to note is that it only checks, if there are no pending tasks queued, it uses very minimal resources and exits quickly.
WP Mail SMTP uses Action Scheduler specifically to handle background tasks like email logging, email reports, and other resource-intensive operations, so they don’t slow down your site’s front end.
Regarding your index.php going “crazy” in SSH after 24 hours, this is worth investigating a bit more carefully. A few things that could cause this:
- A large backlog of queued actions: If there are many past-due actions stacking up, Action Scheduler will try to process them all, which can spike server activity. You can check this by going to WP Mail SMTP » Tools » Scheduled Actions in your WordPress dashboard and looking for a high volume of pending or failed actions.
- Another plugin also using Action Scheduler: Since Action Scheduler is shared across plugins, if you have WooCommerce or WPForms active as well, their scheduled tasks run through the same hook. It’s worth checking which plugins’ tasks are actually filling the queue.
For a full overview of how WP Mail SMTP uses Action Scheduler, this doc may be helpful.
Hope this clears things up! Let us know if you have any other questions.
Kind regards.
Hey @paddyam how are you? thank you for your response.
The documentation confirms exactly what I suspected: to actually see the problems, you must install the original plugin. I opened a support ticket with them before sending my ticket here because I was suspicious about this.
The only issue with this plugin is that it does not get updated very often, and the support on ww.wp.xz.cn for this specific plugin is a bit slow.
There are a couple of things I need to understand:
- Let’s say the version of the library installed by your plugin is older than the one included in the original plugin. What will happen in that case? Will the library be installed multiple times in different versions?
- The Action Scheduler cron job runs every minute. On my server, I have a system cron that runs every 5 minutes using
wget. Could this cause the cron jobs to pile up? This is what I suspect might be happening, and it might explain why the server sometimes gets overloaded.
As I mentioned, I already opened a ticket with the original plugin. You can see it here:
https://ww.wp.xz.cn/support/topic/question-about-the-admin-gui-of-your-plugin-when-used-with-other-plugins/If you can help me understand these two questions, I would really appreciate it.
Thank you for your response.
Regards,
LeviHi @123nadav,
Thanks for the update and the follow-up questions.
1. Multiple versions of Action Scheduler
When multiple plugins bundle Action Scheduler, WordPress automatically uses whichever version is the most recent one loaded. The library is designed to handle this it runs a version check on load and the newest version takes over, so you won’t end up with multiple instances running in parallel.
2. System cron + WP-Cron overlap
When you run a system cron every 5 minutes via
wget, it triggerswp-cron.phpdirectly. Meanwhile, Action Scheduler’s internal hook fires every minute through WP-Cron. If your system cron is hittingwp-cron.phpwhile WP-Cron is also running via normal page loads, you can end up with overlapping cron runs, which causes actions to pile up and spike server activity.Hope that helps clarify things! Let us know if anything else comes up.
Kind regards.
The WP-Cron is not running via normal page loads. I set the following in
wp-config.php:define('DISABLE_WP_CRON', true);So the only cron that actually runs is the server cron every 5 minutes.
I noticed that when installing the original plugin:
https://ww.wp.xz.cn/plugins/action-scheduler/After installation, it performs a migration. I believe the problem is trying to use your plugin without installing this actual plugin.
We know the main plugin was designed for WooCommerce (the official plugin from Automattic / WordPress.com).
So I believe that if you are not running a WooCommerce website, you should install this plugin. Maybe it creates the required database tables (I don’t see any other reason for the migration to start).
But anyway, you answered all my questions. Thank you very much @paddyam , I really appreciate your time.
Regards,
LeviHi @123nadav,
Thanks for the follow-up, glad I was able to answer the questions, and thanks for digging into it so thoroughly.
If something else comes up, or you have any question on WP Mail SMTP, don’t hesitate to reach out.
You must be logged in to reply to this topic.