Cart too slow with 500+ active Product Category discounts

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 года назад
On v4.3 (Azure App Service S2 - 3.5GB Ram, quad-core) with S1 - 50 DTU SQL Azure.

Everything that requires DB access works fairly fast except for Cart.
Any cart addition is painfully slow. Taking 7 to 8 seconds even on localhost.

Implemented everything in performance guide . Obviously, I can't disable discounts or enable cache for prices due to the Product category based discounts requirement of the customer.

Code investigation revealed that the application of discounts is somewhat convoluted with multiple interactions through the entire catalog for each active category-based discount every time. Even though my product catalog is limited (~50 Skus), but have 500+ Product Category based active discounts.

The moment I remove 350 odd discount records, there is a visible improvement. But can't do it on the production system.

I believe my hardware configuration is more than adequate for ~50 Sku catalog.

What are the ways, I can improve the Cart performance here?
Are there any other configuration options apart from the ones mentioned in the performance guide?
If customization is the only way, what exactly I need to do get the performance up for the cart?
3 года назад
pparaskar wrote:
Even though my product catalog is limited (~50 Skus), i have 500+ Product Category based active discounts. The moment I remove 350 odd discount records, there is a visible improvement. But can't do it on the production system.

The answer is there - its not the number of products that is the issue - you need look at the design for why you need to have that many category discounts active at the same time.
Of course currently all 500 discounts need to be loaded and compared and calculated for each product addition to the cart.
Unless you throw a lot of system resources at the problem - Yes you would need to customise to fix the issue.
If you still really need 500 discounts then you need to look at some optimised SQL Query that elimates some of the options based on parameters before that are all loaded
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.