Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wc_facebook_regenerate_feed Out of Memory issues since 2.3.2 #1871

Closed
2 tasks done
galapogos01 opened this issue Apr 10, 2021 · 23 comments · Fixed by #2099
Closed
2 tasks done

wc_facebook_regenerate_feed Out of Memory issues since 2.3.2 #1871

galapogos01 opened this issue Apr 10, 2021 · 23 comments · Fixed by #2099
Labels
feature: product sync Relating to syncing product data to Facebook. needs feedback The issue/PR needs a response from any of the parties involved in the issue.

Comments

@galapogos01
Copy link

galapogos01 commented Apr 10, 2021

🔎 Isolate the bug

  • I have confirmed this occurs in the most recent version of WordPress, WooCommerce, and Facebook for WooCommerce.
  • I have confirmed this occurs when only WooCommerce and Facebook for WooCommerce are active and when using a default WordPress or WooCommerce theme.

✍️ Describe the bug

Hi guys,

I have a store with over 3500 products.

Since upgrading to 2.3.2, every time the action scheduler task wc_facebook_regenerate_feed runs it is failing due to out of memory issues:
unexpected shutdown: PHP Fatal error Allowed memory size of 419430400 bytes exhausted (tried to allocate 20480 bytes) in /wp-includes/functions.php on line 624

This happens every 15 mins and I have tens of thousands of failed tasks.

As you can see I have already had to raise the single thread memory limit to 400MB which is very high. I had to do this for prior versions to work at all, but it's been failing consistently since the version upgrade.

Removing the Google Product Categories from the config allows the cron instance of the task to run but the action scheduler still reports errors constantly, and Facebook complains that my products have less visibility due to not having Google categories.

Creating this as https://wordpress.org/support/topic/out-of-memory-issues-since-2-3-2/#post-14300819 led me here.

Thanks,
Jason

🚶‍♀️ Steps to reproduce

  1. Install the plugin on a large (3000+ product) site
  2. Watch action scheduler task logs

✔️ Expected behavior

Scheduled tasks should not cause OOM errors.

🗃 Logs

Can provide specific logs on request

@galapogos01 galapogos01 changed the title Out of Memory issues since 2.3.2 ActionScheduler Out of Memory issues since 2.3.2 Apr 10, 2021
@galapogos01 galapogos01 changed the title ActionScheduler Out of Memory issues since 2.3.2 wc_facebook_regenerate_feed Out of Memory issues since 2.3.2 Apr 10, 2021
@danielbitzer
Copy link
Contributor

danielbitzer commented Apr 14, 2021

Hi @galapogos01, thanks for the report!

Could you confirm this issue is present when using the latest (2.3.5) version of the plugin?

@danielbitzer danielbitzer added the needs feedback The issue/PR needs a response from any of the parties involved in the issue. label Apr 14, 2021
@galapogos01
Copy link
Author

Yes @danielbitzer . I think this is different to #1818 as 1818 relates to wp-admin and my ticket is the background AS task.

@danielbitzer danielbitzer added the feature: product sync Relating to syncing product data to Facebook. label Apr 15, 2021
@danielbitzer
Copy link
Contributor

Ok I see. We are currently working on improving the feed and product sync areas of the plugin.

@budzanowski since you've been looking into the feed is there anything we can do here. Sounds like that proposed option to disable the feed would be ideal.

@galapogos01
Copy link
Author

Confirming these are occurring worse in 2.4.0. Happy to provide any logs requested.

@danielbitzer
Copy link
Contributor

@galapogos01 we'll be working on re-building the feed for the next release. 2.4 didn't make any changes to the feed specifically.

@galapogos01
Copy link
Author

Hey guys, how is this tracking? Still dealing with failures and high memory usage on this, reported months ago and hanging out for a fix!

@jgreys
Copy link

jgreys commented Sep 14, 2021

Hello!
Same here. Wasn't having issues before the updates. (~1000 products per site)
Increased the timeout, concurrent batches, memory limit... But still no luck. :(

@danielbitzer
Copy link
Contributor

Howdy, work on this has unfortunately been paused for the moment. We're not sure when it will resume.

@rafal-sokolowski
Copy link

@danielbitzer Is there any workaround, quick fix or temporary solution we could apply in order to make it work? For the moment, the plugin seems to be useless.

@galapogos01
Copy link
Author

It's good at making your web server run out of memory :-(

@rafal-sokolowski
Copy link

It seems to work fine when I run it from CLI.

wp eval "(new SkyVerge\WooCommerce\Facebook\Products\Feed)->regenerate_feed();"

@budzanowski
Copy link
Collaborator

I understand the frustration. We have started work on a new feed generator, that should not experience memory issues. The work is at a fairly advanced stage. Unfortunately, we had to stop. I hope that we will restart the work soon and deliver memory issues free feed generator. PR for reference:
#1989

@galapogos01
Copy link
Author

Hey @budzanowski thanks for the work on the PR / new feed generator. Do you know in which version this will be released? Can the bug be closed if I haven't verified it yet?

@budzanowski
Copy link
Collaborator

@galapogos01 Hey!

Can the bug be closed if I haven't verified it yet?

This is a GitHub feature. The issue was auto-closed when the PR got merged in master. It would be better to verify and then close the issue but most of the time we would end up with issues people forget to close :)

Do you know in which version this will be released?

The next one: 2.6.6. Early next week most probably. If you will find that this did not help then you can reopen the issue with a comment so we can follow up. Or open another Issue if you would find some other problem related to the new code. This is the flow that we use in GitHub for these things. Hopefully, it will work without problems.

@jgreys
Copy link

jgreys commented Oct 20, 2021

@budzanowski Thanks for the work! Looking forward to the upcoming update :)

@galapogos01
Copy link
Author

Legendary, thanks @budzanowski !!

@rafal-sokolowski
Copy link

Unfortunately, in my case, the update hasn't solved the issue.

2021/11/08 11:21:47 [error] 34576#34576: *4660912 FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /www/playground/public/wp-content/plugins/taxonomy-terms-order/include/addons.php on line 47" while reading response header from upstream, client: 34.194.65.22, server: playground.test, request: "POST /wp-admin/admin-ajax.php?action=as_async_request_queue_runner&nonce=1ab2e2b938 HTTP/1.0", upstream: "fastcgi://unix:/var/run/php8.0-fpm-z3tshop.sock:", host: "playground.test", referrer: "https://playground.test/wp-admin/admin-ajax.php?action=as_async_request_queue_runner&nonce=1ab2e2b938"

@budzanowski
Copy link
Collaborator

@rafal-sokolowski
That looks like a memory issue that is comming from another plugin:
/www/playground/public/wp-content/plugins/taxonomy-terms-order and not Facebook For WooCommerce.

@rafal-sokolowski
Copy link

@budzanowski That's true. I know how it looks like but I also got other entries in my log file. When it comes to error location, they are pretty random:

2021/11/08 11:21:47 [error] 34576#34576: *4660912 FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 40960 bytes) in /www/playground/public/wp-includes/option.php on line 502" while reading upstream, client: 34.194.65.22, server: playground.test, request: "POST /wp-admin/admin-ajax.php?action=as_async_request_queue_runner&nonce=1ab2e2b938 HTTP/1.0", upstream: "fastcgi://unix:/var/run/php8.0-fpm-z3tshop.sock:", host: "playground.test", referrer: "https://playground.test/wp-admin/admin-ajax.php?action=as_async_request_queue_runner&nonce=1ab2e2b938"

What they have in common is admin-ajax.php?action=as_async_request_queue_runner and when I comment out schedule_feed_generation, no errors are showing up.

@galapogos01
Copy link
Author

galapogos01 commented Nov 8, 2021

@budzanowski the OOM error is generated by whatever thing next tries to get memory, usually in the main loop of whatever repetitive operation is running.

@rafal-sokolowski did you enable the new feed option? it's not on by default.

I have a 4500 item / 15k post site and have had no errors since enabling. Very happy @budzanowski !!!

@budzanowski
Copy link
Collaborator

@galapogos01 I am glad to hear that!

@rafal-sokolowski the pointer from @galapogos01 is correct, you need to enable the new generator first. More info in https://woocommerce.com/document/facebook-for-woocommerce/#section-25

@rafal-sokolowski
Copy link

@galapogos01 @budzanowski The option wasn't checked indeed. That's probably the case. Thanks for your help!

@budzanowski
Copy link
Collaborator

If you like the update and the progress the plugin is making then please leave a review at https://wordpress.org/plugins/facebook-for-woocommerce/ . We are trying to address a lot of plugin problems and build a solid and helpful product. We still have a long way to go for sure, but we are heading in the right direction.

Thank you all for participating in the process of making the plugin better with each iteration!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: product sync Relating to syncing product data to Facebook. needs feedback The issue/PR needs a response from any of the parties involved in the issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants