Checkout performance best practices
The checkout process in Adobe Commerce is a critical aspect of the storefront experience. It relies on the built-in cart and checkout capabilities.
Performance is key in maintaining a good user experience. Review the performance benchmark summary to learn more about performance expectations. You can optimize checkout performance by configuring the following options for high-throughput order processing:
- AsyncOrder—Asynchronously processes orders using a queue.
- Deferred Total Calculation—Defer calculations for order totals until checkout begins.
- Inventory Check on Cart Load—Choose to skip inventory validation of cart items.
- Load balancing—Enable secondary connections for the MySQL database and Redis instance.
The AsyncOrder, Deferred Total Calculation, and Inventory Check on Cart Load configuration options all work independently. You can use all three features simultaneously or enable and disable the features in any combination.
Asynchronous order placement
The Async Order module enables asynchronous order placement, which marks the order as received
, places the order in a queue, and processes orders from the queue on a first-in-first-out basis. AsyncOrder is disabled by default.
For example, a customer adds a product to their shopping cart and selects Proceed to Checkout. They fill out the Shipping Address form, select their preferred Shipping Method, select a payment method, and place the order. The shopping cart is cleared, the order is marked as Received, but the Product quantity is not adjusted yet, nor is a sales email sent to the customer. The order is received, but the order details are not yet available because the order has not been fully processed. It remains in the queue until the placeOrderProcess
consumer begins, verifies the order with the inventory check feature (enabled by default), and updates the order as follows:
- Product available—the order status changes to Pending, the product quantity is adjusted, an email with order details is sent to the customer, and the successful order details become available for viewing in the Orders and Returns list with actionable options, such as reorder.
- Product out of stock or low supply—the order status changes to Rejected, the Product quantity is not adjusted, an email with order details about the issue is sent to the customer, and the rejected order details become available in the Orders and Returns list with no actionable options.
Use the command-line interface to enable these features, or edit the app/etc/env.php
file according to the corresponding README files defined in the Module Reference Guide.
To enable AsyncOrder:
You can enable AsyncOrder using the command-line interface:
bin/magento setup:config:set --checkout-async 1
The set
command writes the following to the app/etc/env.php
file:
...
'checkout' => [
'async' => 1
]
See AsyncOrder in the Module Reference Guide.
To disable AsyncOrder:
You can disable AsyncOrder using the command-line interface:
bin/magento setup:config:set --checkout-async 0
The set
command writes the following to the app/etc/env.php
file:
...
'checkout' => [
'async' => 0
]
AsyncOrder compatibility
AsyncOrder supports a limited set of Adobe Commerce features.
Standard Checkout
B2B Negotiable Quote
Cash on Delivery
Braintree
PayPal PayFlow Pro
The following features are not supported by AsyncOrder, but continue to work synchronously:
- Payment Methods not included in the supported feature list
- Multi-Address Checkout
- Admin Order Creation
Web API support
When the AsyncOrder module is enabled, the following REST endpoints and GraphQL mutations run asynchronously:
REST:
GraphQL:
Excluding payment methods
Developers can explicitly exclude certain payments methods from asynchronous order placement by adding them to the Magento\AsyncOrder\Model\OrderManagement::paymentMethods
array. Orders that use excluded payment methods are processed synchronously.
Negotiable Quote Async Order
The Negotiable Quote Async Order B2B module enables you to save order items asynchronously for the NegotiableQuote
functionality. You must have AsyncOrder and NegotiableQuote enabled.
Deferred Total Calculation
The Deferred Total Calculation module optimizes the checkout process by deferring the total calculation until it is requested for the shopping cart or during the final checkout steps. When enabled, only the subtotal calculates as a customer adds products to the shopping cart.
Deferred Total Calculation is disabled by default. Use the command-line interface to enable these features, or edit the app/etc/env.php
file according to the corresponding README files defined in the Module Reference Guide.
To enable DeferredTotalCalculation:
You can enable DeferredTotalCalculation using the command-line interface:
bin/magento setup:config:set --deferred-total-calculating 1
The set
command writes the following to the app/etc/env.php
file:
...
'checkout' => [
'deferred_total_calculating' => 1
]
To disable DeferredTotalCalculation:
You can disable DeferredTotalCalculation using the command-line interface:
bin/magento setup:config:set --deferred-total-calculating 0
The set
command writes the following to the app/etc/env.php
file:
...
'checkout' => [
'deferred_total_calculating' => 0
]
See DeferredTotalCalculating in the Module Reference Guide.
Fixed Product Tax
When Deferred Total Calculation is enabled, the Fixed Product Tax (FPT) is not included in the product price and cart subtotal of the mini cart after adding the product to the shopping cart. The FPT calculation is deferred when adding a product to the mini cart. The FPT displays correctly in the shopping cart after proceeding to final checkout.
Disable Inventory check
The Enable Inventory On Cart Load global setting determines whether to perform an inventory check when loading a product in the cart. Disabling the inventory check process improves performance for all checkout steps, particularly when dealing with bulk products in the cart.
When disabled, inventory check does not occur when adding a product to the shopping cart. If this inventory check is skipped, some out-of-stock scenarios could throw other types of errors. An inventory check always occurs at the order placement step, even when disabled.
Enable Inventory Check On Cart Load is enabled (set to Yes) by default. To disable the inventory check when loading the cart, set Enable Inventory Check On Cart Load to No
in the Admin UI Stores > Configuration > Catalog > Inventory > Stock Options section. See Configure Global Options and Catalog Inventory in the User Guide.
Load balancing
You can help balance the load across different nodes by enabling secondary connections for the MySQL database and Redis instance.
Adobe Commerce can read multiple databases or Redis instances asynchronously. If you are using Commerce on cloud infrastructure, you can configure the secondary connections by editing the MYSQL_USE_SLAVE_CONNECTION and REDIS_USE_SLAVE_CONNECTION values in the .magento.env.yaml
file. Only one node needs to handle read-write traffic, so setting the variables to true
results in creating a secondary connection for read-only traffic. Set the values to false
to remove any existing read-only connection array from the env.php
file.
Example of the .magento.env.yaml
file:
stage:
deploy:
MYSQL_USE_SLAVE_CONNECTION: true
REDIS_USE_SLAVE_CONNECTION: true