-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Redis Session locking makes add to cart action very slow and cpu spikes #39824
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
Comments
Hi @ioweb-gr. Thank you for your report.
Join Magento Community Engineering Slack and ask your questions in #github channel. |
Hello @ioweb-gr, Thanks for the report and collaboration! We have tried to reproduce this issue in the latest 2.4-develop branch and 2.4.8 vanilla instance but it seems the issue is not reproducible for us. We have followed the below steps to reproduce the issue:
Category-1.webmPlease let us know if we missed anything. Thanks |
Hi @engcom-Hotel. Thank you for working on this issue.
|
In your install command you have set disable-locking=1 not 0 that's why it's not replicating Please set disable-locking to 0 and retry |
Hello @ioweb-gr, We have made the Please refer to the below screencast: 1-min.mp4Let us know if we missed anything. Thanks |
OK I checked your video. It seems you're adding the item , pausing until it's added, adding the item, pausing until it's added etc etc. Try it without pausing in between pressing add to cart button and check the network waterfall in the inspector. Only then will locking take place for a really long period while still occupying the php-fpm processes |
Hello @ioweb-gr, Thanks for the reply! But still we are unable to reproduce the issue. Can you please share some screencast, it helps us in issue reproduction? Thanks |
Here's an example with a simplified way to reproduce it Add a few products in your cart and then visit the category page. On the console tab write this command to simultaneously click on all add to cart buttons
firefox_i8HKewAisp.mp4Watch the network tab after filtering for cart/add You will notice the duration fluctuates due to session locking The problem comes because nowdays this can be spammed a lot by a lot of automated tools bringing down the whole server. I've seen loads spike up to 500 on a 48 core machine because someone is spamming add to cart button. That's effectively a DoS attack by just clicking add to cart button |
Hello @ioweb-gr, Thanks for more information on this issue. We are able to reproduce this issue now in the 2.4-develop branch. Please refer to the below screenshot for the reference: Hence confirming the issue. Thanks |
✅ Jira issue https://jira.corp.adobe.com/browse/AC-14609 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-Hotel. Thank you for verifying the issue. |
Preconditions and environment
Steps to reproduce
You will notice lots of profile recordings like this
First of all the speed of adding to cart shouldn't be affected so hard.
Secondly as a side-effect, while this is occuring the php-fpm requests are hanging in the CPU occupying fpm children and leading to the cores being fully utilized preventing other operations from occurring.
When this happens in bulk , e.g. from spiders like META, Google , Bytedance etc etc the load on a server can go really high.
Expected result
Add to cart is processed normally
For example if we disable locking
Actual result
The add-to-cart action slows down a lot and especially the more products we have to the cart it increases further
Additional information
No response
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: