Jump to content

Adding Items to Cart Very Slow


Recommended Posts

We've been experiencing a problem with a website that manifests itself when the site was moved from development to a production server. The dev server is a smaller slower machine, but the site runs at normal speed there, while the production server is much faster (contains a few perfectly fast PS sites) but the site is slow there (well over 10s to add a product to the cart).

 

Both sites are configured identically and running on the same OS (both virtual machines running CentOS 5.9, but the dev site that is running at normal speed is just configured with less memory/ CPU / disk space than the production site which is slow). On both sites all caching is off, ajax cart is off, friendly URLs are off, both are updated to the latest PS version (1.5.4), and just to be sure everything was the same, we made an exact copy of the production site / DB and put it on the dev server (same results). Here's a corresponding product page on both sites, try adding the product to your cart to see the speed difference:

 

Production Site (slowwwwwww):

http://www.treefrogf...troller=product

 

Dev Site (normal speed):

http://treefrog.nure...troller=product

 

Attached are images showing the profiler output (_PS_DEBUG_PROFILING_ set to true in config/defines.inc.php) for both sites. The slow site runs more queries for some reason, but the time spent doing those queries is not a significant portion of total load time for either scenario. As you can see in the images, the big time eater on the slow site is shown as being in the "init" phase, so maybe someone could provide guidance on troubleshooting this further.

 

Any help troubleshooting would be very much appreciated!

post-337625-0-26994200-1371135841_thumb.png

post-337625-0-15107300-1371135910_thumb.png

Link to comment
Share on other sites

Hello, thank you for the post

 

When I tested both websites, they both ran fast and at the same speed until I added a product to cart.

 

When looking at the Chrome Dev Console, I saw a difference between these two identical product pages (one dev, one production)

 

Dev: http://treefrog.nure...troller=product

Production: http://www.treefrogf...troller=product

 

The difference is attached in the picture.

 

 

Could it be that the font transfer is causing the extra load time?

post-360108-0-67161000-1371138852_thumb.jpg

  • Like 1
Link to comment
Share on other sites

We had the same issue, we found to have to do with the shipping modules fedex/usps that came with 1.5.4 install as default addons.

 

When we disabled, the site speed would be 100%, when enabling carriers, it would make the site come to a crawl when adding products to the site.

 

We ended up having to buy custom modules for fedex/usps to avoid the issue.

Link to comment
Share on other sites

Thanks Benjamin for finding that. It was due to a missing mime type on the production (slow) server. We fixed it but it doesn't seem to be related to the problem.

 

mikey3232, we'll try turning off shipping modules to see if that is the issue, thanks for the suggestion.

 

The biggest chunk of time is being spent in "init" according to the profile ... any idea what that means or how we can troubleshoot it?

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

The one change we made that made a difference was disabling the UPS module. This took the time of adding a product from around 8.6s to 4.6s. This is still slower than we'd like, but way faster than it was.

 

Is it possible that the UPS module is communicating in any ways that might be blocked by more aggressive firewall settings on the production server vs development server?

 

Either way, 4.6s to just add something is still way slower than any other PS site hosted on the same machine, something else must be going on as well.

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

We haven't been able to figure out the speed issues. Turning caching on has put a bandaid on the problem by making products that have been previously added fairly fast, but adding something for the first time, or adding a product you have already added in order to have a different number of that product in your cart than have ever been added, is still extremely slow, and any insight on how to troubleshoot further would be super valuable to us.

 

Correction: Caching will only speed up a few products at a time, so the majority of additions to a cart still require 10s+ to complete :(

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

It turns out that mikey3232 was right on the money. We tried disabling both FedEx and UPS with no effect, and decided that wasn't the issue, but when we finally just completely uninstalled both it worked. Turns out that FedEx is causing our problem (using just UPS works).

 

Does anyone know if that module makes a request when adding or removing a product to a cart that might be getting blocked? Meanwhile, we'll try installing Prestochango's FedEx module to see if it works properly.

Link to comment
Share on other sites

One final note to confirm that this issue is resolved. We uninstalled both the UPS and FedEx modules that come with PS. Both turned out to be extremely slow. We installed Prestochango's modules, and adding an item to the cart is now reasonably fast (2.5s for the AJAX call before it is cached ... would like it to be faster, but this is at least acceptable ... and a fraction of a second once the shipping rate is cached).

 

Thanks to mikey3232 for pointing us in the right.

Link to comment
Share on other sites

  • 1 month later...

I found the animation of the products flying over to the cart to slow our site down.

I have disabled this and use a modal window, which is faster and looks more professional.

 

The instructions for doing this are on this page.

 

http://nemops.com/better-prestashop-add-to-cart/

 

Just do step 1 first, and if you want the popup modal window then carry on with the rest :)

Link to comment
Share on other sites

The issue unfortunately is not ajax or the animation, it has to do with the FedEx module. Every time an item is added to the cart or removed there is a delay of 20-30 seconds before its added or removed from the cart. If i disable the FedEx module, everything runs at normal operational speed.

Link to comment
Share on other sites

  • 2 months later...

I have the same problem as Spyhawk so I disabled the FedEx module and disable all of the fedex carriers from Shipping->Carriers.  This helped but it is still painfully slow to add/remove items to/from the cart and updating quantities on the cart is still very slow...

 

Doing more searching......

Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...

Im experiancing same problem, but i think i know why.

1.im developing my fedex shipping, this module take few second to get rate from their fedex web this problem make slow in adding product items.

 

2.for something i dont understand getordershppingcost function always looping

 

3. So i think using any shipping modul who connect to external web, cause slowing

 

(Sorry my english)

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...