Huge Action Scheduler tables
-
Hello,
I’ve found that site database has grown up to 2GB
and most the size is coming from tables:
1. fc1_actionscheduler_actions – 777,8MB, 1788299 rows
2. fc1_actionscheduler_logs – 800,1 MB, 6038759 rowsMost of this count is for the hook: adjust_download_permissions – 1769975
How to fix this?
-
Hello there,
The action scheduler should automatically delete expired actions in order to prevent issues like this.When this does not happen, it most commonly is because of WP Cron not working or being disabled.
Please, check if WP Cron is shown with a green tick in WooCommerce > Status > System Status. If it is not, you will want to fix that by enabling WP Cron (if disabled) or contacting your host to see what the issue might be with it.
Hello,
WP Cron has the green tick.
The latest is from 10.02.2021.
As temporary solution I manually deleted all records older than a week.
But only yesterday the row count was over 4000 in the fc1_actionscheduler_actions tableSame issue for me. adjust_download_permissions runs almost constantly. I cleared out the table a week ago and it’s already at 102,000 and climbing.
Same issue for me. Over 26,000 adjust_download_permissions the last 7 days, and it just keeps adding/running more.
Have any of you figured out what is causing this?Same for me, anyone knows what this cron job does? We dont even have any downloadable product.
Same here. It keeps adjusting download permissions on non-downloadable products. Any solutions?
- This reply was modified 3 years, 4 months ago by secondspring.
Same here. I have a client site with ~600 products. I see adjust_download_permissions being added into the Action Scheduler every 15 minutes. It creates around 10,000 entries a day that complete without error. They have zero digital download products on their site.
I installed Crontrol and checked to ensure there was no 15 minute job in WP cron. I suspect a plugin or incoming webhook to be the cause. They run Printful and NetSuite integrations, Google Product Feed, among other things that I have suspicions about. I’m working to clean this site up substantially. We have Woo v5.1.1 (four minor releases behind) and are preparing to upgrade soon. I’ll reply when I figure this out.
Resolved
- This reply was modified 3 years, 2 months ago by Konijntje.
- This reply was modified 3 years, 2 months ago by Konijntje.
- This reply was modified 3 years, 2 months ago by Konijntje.
- This reply was modified 3 years, 2 months ago by Konijntje.
- This reply was modified 3 years, 2 months ago by Konijntje.
- This reply was modified 3 years, 2 months ago by Konijntje.
Here’s some updates:
Upgrading WooCommerce to the latest v5.5.2 has not resolved this for us.
I am unable to reproduce the problem on local sandbox environment taking the exact database, theme and plugins and only modifying the siteurl value. Same for a recent staging environment copy on the production host.
Inside WC_Product_Data_Store_CPT::update() in Woo core it triggers maybe_schedule_adjust_download_permissions() on all updates. The question is what may be using that and updating the products every 15 minutes.
I see plugin woocommerce-google-adwords-conversion-tracking-tag using it for find_matching_product_variation().
I see plugin woocommerce-product-bundles extending the class for WC_Product_Bundle_Data_Store_CPT. This client does have 13 product bundles on their site.
Maybe some clues there. Still researching this…
I added a tiny code snippet to cancel the schedules of adjust_download_permissions. They initially show up as Cancelled then cease rolling in. It works, but if I disable the code snippet they begin to re-appear after 30 minutes or so.
I also found this does not solve our Printful and Klaviyo product.updated web hooks (they still fire all the time unless disabled). So not a real fix here, just a bandaid:
add_action( 'init', function() { as_unschedule_all_actions( 'adjust_download_permissions' ); } );
Hello @seanconklin, thanks for the insights on that code snippet. I have a couple of questions:
1. Where do you place that snippet?
2. I suppose cancelling those adjust_download_permissions hooks means that they won’t ever run, right?Cheers,
AlexHello @zaetheo
You can use the Code Snippets plugin to manage your custom functions. Alternatively some developers use the functions.php file inside the active child theme’s folder, if applicable.
The actions show up as Cancelled initially then they cease to appear as long as this function is active.
I believe this problem is triggered by an inventory sync plugin that uses the Product Datastore object in WooCommerce, which in turn fires the product updated hooks at every cycle on stock quantity writes or changes. In turn it sets off Printful and Klaviyo web hooks, further loading the Action Scheduler. That’s my observations thus far. It’s been a real tricky one!
Hey.
Reporting in with the same issue using the latest Woo. Just like @seanconklin said – there’s no such issue on a local staging site copy.
The amount of data generated is insane. Some stats from the SQL server (sharing, because I’ve never seen anything like this):
Uptime: 5 days 2 hours
Traffic: 13.3 TiB
Traffic per hour: 111.9 GiB
Connections per hour: 115K
Select statements per hour: 17.2MI’m currently using Sean’s “bandaid” solution – better than nothing. Have you had any luck solving this issue so far?
Hi @juregolob
Sorry to hear about this.
To check much better into your case, you can create your own thread:
https://wordpress.org/support/plugin/woocommerce/#new-topic-0.Please share a copy of your site’s System Status You can find it via WooCommerce > Status. Select “Get system report” and then “Copy for support”.
Also, share a copy of any fatal error log found under WooCommerce > System Status > Logs (if available).
Let us know, thank you.
- The topic ‘Huge Action Scheduler tables’ is closed to new replies.