ACSD-57477: Sales rule processing slows performance on cart-related requests
The ACSD-57477 patch fixes the issue where sales rule processing causes slow performance on cart-related requests. This patch is available when the Quality Patches Tool (QPT) 1.1.69 is installed. The patch ID is ACSD-57477. Please note that this issue is scheduled to be fixed in ÃÛ¶¹ÊÓÆµ Commerce 2.4.7.
Affected products and versions
The patch is created for ÃÛ¶¹ÊÓÆµ Commerce version:
- ÃÛ¶¹ÊÓÆµ Commerce (all deployment methods) 2.4.6-p2
Compatible with ÃÛ¶¹ÊÓÆµ Commerce versions:
- ÃÛ¶¹ÊÓÆµ Commerce (all deployment methods) 2.4.6 - 2.4.6-p11
magento/quality-patches
package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.Issue
Sales rule processing causes slow performance on cart-related requests if you send the parameters as GraphQL variables.
Steps to reproduce:
-
Add 1000 product attributes.
-
Create a cart using below GraphQL query.
code language-none mutation {createEmptyCart}{noformat}
-
Add a product to cart using below GraphQL query.
code language-none mutation AddProductsToCart($cartId: String!, $products: [CartItemInput!]!) { addProductsToCart(cartId: $cartId, cartItems: $products) { cart { id __typename } __typename } }
-
Set these Variables.
code language-none { "cartId": "id_here", "products": [ { "sku": "product_dynamic_1", "parent_sku": "product_dynamic_1", "quantity": 1 } ] }
-
This issue occurs only when you send the parameters as GraphQL variables. If you include the parameters into the GraphQL query itself, then this issue doesn’t occur.
-
Send the same Add To Cart request after adding parameters into the GraphQL query itself.
code language-none mutation { addProductsToCart( cartId: "id_here" cartItems: [ { sku: "product_dynamic_1", parent_sku: "product_dynamic_1", quantity: 1 } ] ) { cart { id __typename } __typename } }
Expected results:
The AddProductsToCart
GraphQL operation performance shouldn’t be degraded.
Actual results:
The AddProductsToCart
GraphQL operation performance degrades, because it loads all product attributes when parameters are sent as variables.
Apply the patch
To apply individual patches, use the following links depending on your deployment method:
- ÃÛ¶¹ÊÓÆµ Commerce or Magento Open Source on-premises: Quality Patches Tool > Usage in the Quality Patches Tool guide
- ÃÛ¶¹ÊÓÆµ Commerce on cloud infrastructure: Upgrades and Patches > Apply Patches in the Commerce on Cloud Infrastructure guide
Related reading
To learn more about Quality Patches Tool, refer to:
- Quality Patches Tool: A self-service tool for quality patches in the Tools guide