-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Pricing Index runs without ever completing - Magento 2.3.1 #22516
Comments
Hi @batmike. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @batmike do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
@magento-engcom-team give me 2.3.1 instance |
Hi @batmike. Thank you for your request. I'm working on Magento 2.3.1 instance for you |
Hi @batmike, here is your Magento instance. |
I have the instance but cannot confirm as I would need to run some kind of sample data loader to build out a similar configurable/simple product catalog like we have in production. I also have to way to run the indexer from the CLI. If these are available to run in a test vanilla environment, I'd be happy to test and see if it still does a similar thing to what we experienced. |
@orlangur - of course it is! Just trying to get used to talking more with the machines than people ahead of time. |
We are experiencing the same issue in 2.3.1 (multi-site, +80k SKUs (around 15k configurable, with simples attached), with the price index taking like forever (7+ hours), though we actually managed to finish it, and thus have the product appear in the store. We are trying to tune the batch size (https://devdocs.magento.com/guides/v2.3/extension-dev-guide/indexer-batch.html), which seems to might affect this, so recommend others experiencing this issue to also check the batching as mentioned in the above link. |
@royandre we're in a similar situation and get a very slow price reindexing. We adjusted the batch size for configurable and default down to 1000 and the improvement is not great. What batching setup did you end up using? Investigating the catalog_product_index_price_temp temporal table I can see that it gets populated by a query that is exponentially slower as more products are enabled in more store views or at least that's what I think. 2.3.1 EE, 60k SKUs, 7k configurables |
It looks like this guy ignores product's type when it creates batches and therefore each indexer walks through all the products: https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/Model/Indexer/Product/Price/Action/Full.php#L275 |
Hi @andimov. Thank you for working on this issue.
|
@batmike, @royandre, @acampos1916 do you have Magento Inventory (MSI) enabled in your Magento installation? |
@andimov - we do not have any of the MSI modules enabled in our install. |
@andimov we do have MSI enabled. |
Trigger is not working correctly: vendor/magento/framework/Mview/View/Subscription.php Magento 2.2.5:
Magento 2.3.1:
!= is not <=> |
@batmike, @acampos1916, thank you for your answers. There are several reasons why price indexation takes a long time for large data profiles:
|
@andimov - I made the change to the getBatchesForIndexer() method but it didn't seem to improve the indexing time, with or without the batch modification. However, I enabled the MSI modules and then applied the PR 2336 and the rebuild now completes in just a couple minutes. Is there any reason that the processing should still be degraded so much with MSI disabled though? |
@batmike thank you for updates! I performed tests with data profile 10 times less as you described with fresh Magento Open Source installation from 2.3-develop and I received such results:
I also performed tests with Magento Commerce along with MSI with a large profile (10m eSKU) and I wasn't able to receive successful indexation for 50+ hours. With hotfix similar to magento/inventory#2336 it was completed in 5 hours. |
@andimov - Yes, you are right and your numbers look similar to what I'm seeing. When I let it run longer to test out the full benefit of the fix, the price indexing on our store completed in about 1.5 hours, which was much better than not finishing at all. 1.5 hours still isn't great compared to 5-6 minutes as we got prior in version 2.3.0 but ideally we would be able to use more of the incremental indexing rather than full reindexes which should reduce processing as well. |
@batmike your issue (without msi enabled) could be related to #23294. You should try the fix. |
@seyuf - thanks for the ideas! I made the change in #23294 but it didn't result in much improvement. I've had it running in our staging environment and it's consistently reindexing pricing in about 50 minutes so the 1.5 hour mark I mentioned earlier wasn't exactly right. I did also give the multi-threading a try but from looking into that, it seems that it would really only be helpful if we had multiple types of pricing - i.e. store views, customer types, and so on - and it would index those various breakouts in parallel. We have a simple setup though with just one store view and no pricing tiers or anything so there's unfortunately not much to parallel process. |
@batmike if you're sure you've correctly applied the fix... |
@seyuf - I didn't originally confirm that so I ran setup:upgrade and confirmed that the triggers are updated in the database with NOT NEW. They are correct now but the price reindexing for us is still taking 50 minutes. I'm not against blaming our environment or even the ratio we have of configurable to simple products, which is about 1 configurable for every 40 simple products on average but in reality it's probably a much wider range with many being 1:5 but a number of them much higher around 1:100 or so. |
Yeah, there should be no increase in full reindexing performance due to the fix. But it will allow you to avoid full reindexing in favor of incremental one. Also on 2.3.1, to avoid indexing issues i set the index cron group (from the BO admin section) Use Separate Process to no. To avoid conflicts during incremental indexing. |
@seyuf - that sounds very good. I'll be testing that out and update here with the results. Thanks! Update ... changing to the incremental updating could potentially work but we have a process that imports stock quantity updates from our inventory system and that's pretty much constant as we have physical stores that sell and transfrer items throughout the day so updated quantities are constantly coming into our site to be processed. With that, using the incremental indexing even just on pricing hangs up the database as each of those stock updates triggers some reindex processes that make it take much longer and drag the site down. In the end, this has resulted in a good compromise as we've been able to enable incremental indexing on some of the indexes and then keep full indexing enabled for the bigger ones that take too long for the Magento crontab jobs to deal with. The fixes above noted by @andimov did definitely resolve the major issue with the index taking 10s or 100s of hours, which was my main thing. |
Thanks all, PR with changes were delivered |
The issue has been fixed in 2.3-develop branch |
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
The text was updated successfully, but these errors were encountered: