kilroy13 Posted March 14, 2006 Posted March 14, 2006 Hello, I hope someone has some suggestions for my problem. Have a site up and running now nearly two years (http://www.comicsupply.com). Traffic and sales have been steadily increasing. Lately we have had some problems (maybe we had them the whole time and just never knew till now). We have now moved the site to a dedicated server, general speed is much better, HOWEVER, if someone adds a lot to their cart (say 30+ products), the shopping cart load is massively long (like a minute). I have removed the shopping cart box from the right hand side, but I can't figure out what to do to get the shopping_cart.php to load faster, and the entire checkout process if there are a lot of products in the cart. Now it is not uncommon to have someone buy 20+ products at a time because of the type of products (comics) and the fact they can be relatively cheap. Are there any tweaks out there for this? As the problem is on the shopping_cart and checkout pages (and the shopping_cart box) I assume its something to do with the function that sets the shopping cart array. I know if I add say 50 products and do a sql count its like 1700 queries! So something has to be looping unessasarily. Any help appreciated
kilroy13 Posted March 16, 2006 Author Posted March 16, 2006 Well if anyone else has this problem it looks like I found the problem. I have the quantities discount contrib added. Part of that contrib is a file called PriceFormatter.php. This file has a very nasty SQL query in it with joins.. When I loaded a page with a lot of items in the cart, that query was called 3 times for each product in the cart. A normal query time for other queries was about .0001 second, each call to this query in PriceFromatter was .2 sec ! (.2 x 3 x 25 products = 15 seconds). Now it might be so slow because we have 25k + products. I removed the quantity discount contrib and sql calls (will price those types of items a different way in the future) and now the cart with 50 items will load in 2 secs or less.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.