Since1953 Posted April 25, 2013 Share Posted April 25, 2013 I have tried it on a few different installations of 1.5.X with similar results. I am currently running 1.5.3. Consistently, when you click "add to cart" it takes about 5 seconds for the product to be added to the cart. I've used firebug to determine that the delay is happening during the POST function. The GET function takes under 100ms, which is acceptable. Is there a way to speed this up? Link to comment Share on other sites More sharing options...
Since1953 Posted April 25, 2013 Author Share Posted April 25, 2013 This is the log from mysql_slow_queries: # Wed Apr 24 10:17:28 2013 # Query_time: 3.512260 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0 use tvspecia_pre2; SET timestamp=1366820248; SET NAMES 'utf8' # Wed Apr 24 10:23:13 2013 # Query_time: 1.987945 Lock_time: 0.000186 Rows_sent: 1 Rows_examined: 18 use tvspecia_pre2; SET timestamp=1366820593; SELECT COUNT(DISTINCT nl.`id_prestablog_news`) AS `value` FROM `bhb_prestablog_news_lang` As nl LEFT JOIN `bhb_prestablog_correspondancecategorie` As co ON (co.news = nl.id_prestablog_news) LEFT JOIN `bhb_prestablog_categorie` As c ON (co.categorie = c.id_prestablog_categorie) LEFT JOIN `bhb_prestablog_news` As n ON (nl.id_prestablog_news = n.id_prestablog_news) WHERE n.`actif` = 1 AND nl.`id_lang` = 1 AND nl.`actif_langue` = 1 AND TIMESTAMP(n.`date`) <= '2013/04/24 12:23:11' AND c.`actif` = 1 AND c.id_prestablog_categorie = 2 LIMIT 1 # Wed Apr 24 10:23:17 2013 # Query_time: 1.271403 Lock_time: 0.000916 Rows_sent: 1 Rows_examined: 1 use tvspecia_pre2; SET timestamp=1366820597; SELECT `name`, `meta_title`, `meta_description`, `meta_keywords` FROM `bhb_manufacturer_lang` ml LEFT JOIN `bhb_manufacturer` m ON (ml.`id_manufacturer` = m.`id_manufacturer`) WHERE ml.id_lang = 1 AND ml.id_manufacturer = 7 LIMIT 1 # Wed Apr 24 10:23:17 2013 # Query_time: 3.795317 Lock_time: 0.002723 Rows_sent: 10 Rows_examined: 2143 use tvspecia_pre2; SET timestamp=1366820597; SELECT p.*, product_shop.*, product_shop.id_category_default, pl.*, i.id_image, il.legend, m.name manufacturer_name, DATEDIFF(product_shop.`date_add`, DATE_SUB(NOW(), INTERVAL 0 DAY)) > 0 AS new FROM `bhb_category_product` cp LEFT JOIN bhb_category c ON (c.id_category = cp.id_category) LEFT JOIN `bhb_product` p ON p.`id_product` = cp.`id_product` INNER JOIN bhb_product_shop product_shop ON (product_shop.id_product = p.id_product AND product_shop.id_shop = 1) LEFT JOIN bhb_product_lang pl ON (pl.id_product = p.id_product) LEFT JOIN bhb_image i ON (i.id_product = p.id_product AND i.cover = 1) LEFT JOIN bhb_image_lang il ON (i.id_image = il.id_image AND il.id_lang = 1) LEFT JOIN bhb_manufacturer m ON (m.id_manufacturer = p.id_manufacturer) WHERE product_shop.`active` = 1 AND c.nleft >= 7 AND c.nright <= 24 AND c.active = 1 AND pl.id_lang = 1 AND p.id_product IN (12,22,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,78,79,80,81,82,83,85,86,87,88,89,90,91,184,192,1348,1349,1350,1351,1402,1403,1404,1405,1406,1407,1408,1409,1410,1411,1412,1427,1428,1429,1430,1431,1432,1433,1435,1436,1437,1438,1439,1440,1441,1442,1443,1444,1445,1446,1447,1448,1449,1450,1451,1452,1453,1454,1455,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1476,1477,1478,1479,1480,1481,1482,1483,1484,1485,1486,1487,1488,1489,1490) GROUP BY p.id_product ORDER BY pl.name asc LIMIT 20,10 # Wed Apr 24 10:25:57 2013 # Query_time: 1.495897 Lock_time: 0.000213 Rows_sent: 1 Rows_examined: 18 use tvspecia_pre2; SET timestamp=1366820757; SELECT COUNT(DISTINCT nl.`id_prestablog_news`) AS `value` FROM `bhb_prestablog_news_lang` As nl LEFT JOIN `bhb_prestablog_correspondancecategorie` As co ON (co.news = nl.id_prestablog_news) LEFT JOIN `bhb_prestablog_categorie` As c ON (co.categorie = c.id_prestablog_categorie) LEFT JOIN `bhb_prestablog_news` As n ON (nl.id_prestablog_news = n.id_prestablog_news) WHERE n.`actif` = 1 AND nl.`id_lang` = 1 AND nl.`actif_langue` = 1 AND TIMESTAMP(n.`date`) <= '2013/04/24 12:25:56' AND c.`actif` = 1 AND c.id_prestablog_categorie = 2 LIMIT 1 # Wed Apr 24 10:26:46 2013 # Query_time: 2.179915 Lock_time: 0.000137 Rows_sent: 1 Rows_examined: 1 use tvspecia_pre2; SET timestamp=1366820806; SELECT * FROM `bhb_carrier` a LEFT JOIN `bhb_carrier_shop` `c` ON a.id_carrier = c.id_carrier AND c.id_shop = 1 WHERE (a.id_carrier = 24) LIMIT 1 # Wed Apr 24 10:27:02 2013 # Query_time: 1.455544 Lock_time: 0.000220 Rows_sent: 0 Rows_examined: 1 use tvspecia_pre2; SET timestamp=1366820822; UPDATE `bhb_configuration` SET `value` = '4',`date_upd` = '2013-04-24 12:27:00' WHERE `name` = 'PS_SHIPPING_HANDLING' AND id_shop_group IS NULL AND id_shop IS NULL LIMIT 1 # Wed Apr 24 10:30:24 2013 # Query_time: 1.728818 Lock_time: 0.000241 Rows_sent: 1 Rows_examined: 18 use tvspecia_pre2; SET timestamp=1366821024; SELECT COUNT(DISTINCT nl.`id_prestablog_news`) AS `value` FROM `bhb_prestablog_news_lang` As nl LEFT JOIN `bhb_prestablog_correspondancecategorie` As co ON (co.news = nl.id_prestablog_news) LEFT JOIN `bhb_prestablog_categorie` As c ON (co.categorie = c.id_prestablog_categorie) LEFT JOIN `bhb_prestablog_news` As n ON (nl.id_prestablog_news = n.id_prestablog_news) WHERE n.`actif` = 1 AND nl.`id_lang` = 1 AND nl.`actif_langue` = 1 AND TIMESTAMP(n.`date`) <= '2013/04/24 12:30:23' AND c.`actif` = 1 AND c.id_prestablog_categorie = 2 LIMIT 1 Link to comment Share on other sites More sharing options...
bellini13 Posted April 27, 2013 Share Posted April 27, 2013 right off the bat, it took 3.512260 seconds just to issue the "use database" command. you should talk to your host. # Query_time: 3.512260 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0 use tvspecia_pre2; SET timestamp=1366820248; SET NAMES 'utf8' Now, I am not seeing any insert statements in the log. When you add something to the cart, I would expect to see an insert statement for ps_cart table. Perhaps you did not provide all of the slow log, or perhaps the insert statement is not the problem. But you need to start simple, and have the host explain why it would take 3 seconds to just issue a use database command. Link to comment Share on other sites More sharing options...
Recommended Posts