-
Notifications
You must be signed in to change notification settings - Fork 2
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
Backend Cart- & Orderlist slow and breaks with a lot of data #420
Comments
I like the idea of some cart clean up routines so that's defo something we could look at. We've got our initial 6 month roadmap set out, but I think performance could for sure feature on the next iteration. In this solution do you have any discounts or anything setup? Also, was this an upgraded solution? or has it always been a v3 solution? Another thing to try could also be rebuilding the DB indexes to see if that helps too. Maybe we could introduce that as a health check or something. |
Discounts looks like this And yes, I believe the project started on Vendr v1, and has continuously been upgraded to it's current version. It has also been migrated from Umbraco 8 to 10. It's Umbraco Cloud (Azure) so the Rebuild option is not available in SSMS on the indexes (if anyone else is reading this and also try and look for them). So it has to be done through a script, though not sure if I should do everything, or only a subset of index and tables. I'll try on everything on a local backup, and see how that goes. |
Cool, thanks for the additional feedback. I am aware discounts can affect the load time a little as when repopulating orders it checks the discounts again to see if any apply so those can add up too, but yea, I think it sound mostly like a loading from the DB thing. The reason I ask about upgrading is because in v1 we did use plain old guids for ID's but I think it was in v2 we introduced combs for ID's instead. The reason to use combs is because they index better in SQL and so cause less fragmentation. But this will only really help if there are no legacy guid ID's because those will continue to be random and cause index fragmentation. It will be interesting to see though if rebuilding your index does improve stuff too. |
It seems to be a lot faster on a local copy of the DB. Not sure if it's the difference in machine/server, or something happens during export/import. Rebuilding the DB indexes locally did not give any further perceived performance boost. I haven't tried on Live yet. Runnig it locally dd give more some more detailed debugging information, and it seems that the reason for breaking, is this error message in the cart list It comes when I go to the last page of the cart list. I've tried to compare the earliest carts with the latest, but can't find anything seemingly different about them. I've also tried to delete them using the OrderService, but I get the same error. I can view and delete carts from a later date, so i think it's a problem with carts prior to a specific date (don't know what that date is yet). Could it be something updating Vendr og Migrating from Umbraco 8 to 10? Full Stack Trace is
|
Hmm, I'm trying to think why the search method would trigger a store lookup as it should be being passed the store id 🤔 The error usually occurs though when the related product node is not in a tree with an ancesstor with a store picker on it, or if the lucene index is corrupt. I wonder though if one of the products has been deleted and is either in the trash, or doesn't exist. Still, I'm not 100% what is doing the store lookup here. It could be one of the query filters 🤔 |
As mentioned, it does the same in my cleanup task, where this is the query
I have tried rebuilding everything, caches and indexes. I would assume it would be fine to have either deleted products, or products in the recycle bin. You wouldn't have an SQL script for deleting an order on hand, there many references to many tables. If not, I'll put it together myself, and see if I can clear some stuff out, and see if I can figure out what is going on. |
Hey Michael, This is the only script I have which is for deleting everything, but it at least outlines the tables you'll need to be working with
And again, thanks for the feedback. RE deleted products etc, I agree, and like I mentioned last time I'm not sure what is triggering looking up the store as I don't think that should be necessary so I will look into that, my suggestion was only really to see if it could improve anything for you right now 👍 |
Thanks, I appreciate the help. As it turns out, the SQL did not seem as complicated as I first thought. I just looked at all the foreign keys, but naturally it's only those related to OrderId or OrderLineId that is relevant. So I ended up with this
This cleared out all carts older than a week, and now the error I had is gone, and everything is fast again. 👍🥳 I also added a simple Maintenance Dashboard, so moving forward, the client can select a date and delete alle carts or orders created prior to that date. |
Awesome work @MichaelNielsenDK and really appreciate you sharing your SQL script. I'm sure this will a) come in useful for others and b) be super useful for myself when I get to address this 👍 |
When having a lot of data, the cart and orderlist in the backend becomes increasingly slow or break.
Here is an example when going to view the cart list, it takes almost 10 seconds
https://prnt.sc/WFCdm0SKu9cG
If I try and go to the last page in the list, which is pageNumber 8566, it fails
https://prnt.sc/Yy-2sIOekzgv
Umbraco 10.4.2
Vendr v3.0.11
I've implemented a Maintenance Dashboard, so the client on this specific solution, can clean things up.
But perhaps some performance tuning is needed, to handle larger amounts of data, at least so it does not break.
Also, maybe being able to set some clean up rules for carts, as you can for node versions, could be a great add-on.
The text was updated successfully, but these errors were encountered: