Orders with many line items result in long frontend response times
Hello everyone,
A problem we encountered during Black Friday was that customers who place large orders waited a long time for an order confirmation in the frontend.
To debug this issue I looked into the checkout process and measured the times of some methods. I discovered that the call of the runStateMachine method inside the CheckoutWorkflow class in the checkout module took by far the most time to process.
For an order with 260 line items that took 28 seconds to process, this method took roughly 25 seconds of that time. (Note: The most time gets used for database transactions that update the sales order items and insert the oms transition logs).
My solution was no to remove the runStateMachine method call from the placeOrder method and instead activate the initial StateMachine for new orders asynchronously via a Jenkins job.
Since the entire logic is inside the vendor code, my questions is if this problem is known or whether others have also encountered this issue?
Answers
-
We had the similar situation on one project. When you had at around 800 items in the cart, the customer would face 504 gateway timeout on the last checkout step because it would take too much time to process all this items in the place order action.
An the solution that we came up to was the same one that you implemented. We checked the place order action and decided to keep the bare minimum that is necessary in there, and to re-delegate the rest of the necessary logic to some plugins that would be executed via Jenkins.
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 68 Spryker News
- 890 Developer Corner
- 753 Spryker Development
- 83 Spryker Dev Environment
- 360 Spryker Releases
- 3 Oryx frontend framework
- 34 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 22 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 68 Spryker Safari Questions
- 50 Random