-
Notifications
You must be signed in to change notification settings - Fork 254
Description
We found a server performance problem related to the number of products in cart: the more products in cart, the more mysql requests to the server (see in actual results below). A lot of mysql queries are related to inventory_stock information.We have this issue if Magento_Inventory modules are enabled..
We tested it on both magento 2.3 versions: 2.3.0, 2.3.1 and 2.3.2.
Magento 2.2.x versions don’t have this problem.
Preconditions (*)
- Vanila magento CE 2.3.x(composer install) with manually added 10 products via admin
- To see mysql requests you need to:
-
install Mgt_Developertoolbar https://github.com/mgtcommerce/Mgt_Developertoolbar to see the number of requests and enable it Mgt_Developertoolbar Stores --> Configuration --> MGT-COMMERCE.COM --> Developer Toolbar
-
OR Enable Profiler
- PHP 7.1, PHP 7.2
- MYSQL 5.6.38
Steps to reproduce (*)
- Add one product to cart
- Navigate to checkout and check number of mysql requests in developer toolbar
- Add another product to cart
- Navigate to checkout/cart and compare number of mysql requests in developer toolbar
Expected result (*)
The number of requests should not change much, in magento 2.2 it was ok, about + 10 mysql requests per product.
Actual result (*)
With one product in cart:
With two products in cart:
With 10 products in cart:
Here are our results:
Qty | Mysql queries |
---|---|
1 | 176 |
2 | 253 |
3 | 339 |
4 | 416 |
5 | 493 |
6 | 570 |
7 | 647 |
8 | 724 |
9 | 801 |
10 | 869 |
If the Amazon module is activated, an even greater number of requests occur and not only on the checkout page, but on all pages, since it loads the configuration using quote in the isQuoteDirty() function, which generates many mysql requests (Tested on magento 2.3.0)
I duplicated this issue from magento/magento2#22027