Jump to content

Prestashop 1.7.3 super slow due to 1000+ cart rules


BenW

Recommended Posts

Hi there,

Our website got pretty slow after importing 1000+ cart rules (based on category + shipping method).
After enabling profiling, we can see about 1000 queries for carte rules on the homepage when logged in.

If you aren't logged in, everything works fine.

By the way, when profiling is on, hooks information are not showing any hooks - read it was normal on 1.7.3, but is there a way to reimplement it ?

-

I've speeded up the website by deleting unwanted carts from unregistered customers but I'm concerned about the table :

- ps_cart_product showing more than 100 000 rows - is it safe to empty it ? or at least those with the field id_address_delivered set to 0 ?

Questions :

1) Which table can be cleaned up safely ? I already use this module https://mypresta.eu/modules/administration-tools/database-optimization.html

2) Any optimization possible for the carte rules ?

Thanks much

Prestashop 1.7.3 on dedicated server

Edited by BenW (see edit history)
Link to comment
Share on other sites

Hi Ben, 

There is no quick fix for this, and this is one of PS's major issue!

in regards to your question

1. The information in regards to field id_address_delivered set to 0 can be deleted from ps_cart_product. You could empty the entire table, but you need to understand that all carts will be emptied (not that it would count too much, however some visitors who placed products into carts and left it there, they will need to read it again). Personally I would delete all the information's which are older than 30 days!

2.  Delete all expired cart rules- however there is no magical solution there. I presume your add to cart is slow as well!? The add to cart could/can be optimized, but again needs some smart changes ;) 

Unfortunately as mentioned earlier there is no magical solution for that. 

Kind regards, 

Leo 

  • Like 1
Link to comment
Share on other sites

1 hour ago, Prestachamps said:

1. The information in regards to field id_address_delivered set to 0 can be deleted from ps_cart_product. You could empty the entire table, but you need to understand that all carts will be emptied (not that it would count too much, however some visitors who placed products into carts and left it there, they will need to read it again). Personally I would delete all the information's which are older than 30 days!

Yep that sounds good to me, good advice thanks ;) I'll start by emptying old entries and see if there's any changes regarding speed.

2.  Delete all expired cart rules- however there is no magical solution there. I presume your add to cart is slow as well!? The add to cart could/can be optimized, but again needs some smart changes ;) 

That's what I am doing through a little script that I cron run every month
Indeed, add to cart is not slow as well, it's slow as HELL ! 😉. If you have any infos, or insights to share I'm all ears.

 

Thanks for your answer ! 
I'm going to follow your advices.

Best regards

 

Edited by BenW (see edit history)
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...