Jump to content

Time to first byte after upgrading from 1.4.7.0 to 1.5.6.0


Recommended Posts

Hi,

My current active shop is built with Prestashop 1.4.7.0.

I have been working for upgrading to Prestashop 1.5.6.0.
I did the following :
        - I made a copy of my 1.4.7.0 active shop in a sub directory
        - I made a copy of the database
        - so, I created a sub shop
- then, I upgraded this sub-shop to 1.5.6.0 (still in a sub directory, with only private access)

Then, I realized that the page speed display is much more lower on 1.5.6.0 than on 1.4.7.0.

For some similar product_list pages on 1.4.7.0 and 1.5.6.0, the load time has grown from 3 seconds to 25 seconds.

Using tools as pingdom.com, I can see that the trouble comes from the loading of the first byte (Time to load the first byte, TTFB or Get or Wait time)
For the above same pages, the TTFB has grown from 0.78 sec to 23 seconds.
The loading of other page elements (images, css, javascript) has not significantly changed.

Would you have any idea of the causes of such main trouble ?

Thank you in advance for any suggestion.


Patrick

Link to comment
Share on other sites

  • 2 weeks later...

Hi, i have the same problem with only one of my 2 multistore shops. On localhost i found out the query in layered navigation is really slow. Do you have layered navigation enabled?

 

If anyone can help, this is the query (starting from rule 1983 in block layered.php)

 

$this->products = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT
p.*,
'.($alias_where == 'p' ? '' : 'product_shop.*,' ).'
'.$alias_where.'.id_category_default,
pl.*,
MAX(image_shop.`id_image`) id_image,
il.legend, 
m.name manufacturer_name,
MAX(product_attribute_shop.id_product_attribute) id_product_attribute,
DATEDIFF('.$alias_where.'.`date_add`, DATE_SUB(NOW(), INTERVAL '.(int)$nb_day_new_product.' DAY)) > 0 AS new,
stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity
FROM `'._DB_PREFIX_.'category_product` cp
LEFT JOIN '._DB_PREFIX_.'category c ON (c.id_category = cp.id_category)
LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = cp.`id_product`
'.Shop::addSqlAssociation('product', 'p').'
'.Product::sqlStock('p', null, false, Context::getContext()->shop).'
LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').' AND pl.id_lang = '.(int)$cookie->id_lang.')
LEFT JOIN `'._DB_PREFIX_.'image` i  ON (i.`id_product` = p.`id_product`)'.
Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').'
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$cookie->id_lang.')
LEFT JOIN '._DB_PREFIX_.'manufacturer m ON (m.id_manufacturer = p.id_manufacturer)
LEFT JOIN '._DB_PREFIX_.'product_attribute pa ON (p.id_product = pa.id_product)'.
Shop::addSqlAssociation('product_attribute', 'pa', false, 'product_attribute_shop.`default_on` = 1').'
WHERE '.$alias_where.'.`active` = 1 AND '.$alias_where.'.`visibility` IN ("both", "catalog")
AND '.(Configuration::get('PS_LAYERED_FULL_TREE') ? 'c.nleft >= '.(int)$parent->nleft.' AND c.nright <= '.(int)$parent->nright : 'c.id_category = '.(int)$id_parent).'
AND c.active = 1
AND p.id_product IN ('.implode(',', $product_id_list).')
GROUP BY product_shop.id_product
ORDER BY '.Tools::getProductsOrder('by', Tools::getValue('orderby'), true).' '.Tools::getProductsOrder('way', Tools::getValue('orderway')).
' LIMIT '.(((int)$this->page - 1) * $n.','.$n));
}
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...