Jump to content
  • 0

Ponad 5s wczytywania Presty, initFooter w okolicach 35Mb (!)


Hasher

Question

Czy to jest normalne?

Wyłączenie kompilacji szablonu i włączenie cache niewiele zmienia.

Z czego może wynikać np. tak wielki rozmiar initFooter?

 

Poniżej wyniki z włączonego profilowania:

 

 

 

Load time6990 ms
You'd better run your shop on a toaster
Execution Load time (ms) config 174 constructor 0 init 276 checkAccess 0 setMedia 7 postProcess 0 initHeader 0 initContent 1215 initFooter 632 display 4685
Hook processing1777 ms / 15.67 Mb
68 methods called in 40 modules
Hook Processing displayFooter 1.09 Mb in 632 ms displayTop 2.08 Mb in 431 ms displayHeader 11.13 Mb in 292 ms displayProductTabContent 0.28 Mb in 208 ms displayRightColumnProduct 0.60 Mb in 101 ms displayProductButtons 0.29 Mb in 57 ms displayBanner 0.04 Mb in 22 ms displayProductTab 0.09 Mb in 19 ms displayLeftColumnProduct 0.02 Mb in 12 ms customFooter 0.04 Mb in 2 ms displayTopColumn 0.00 Mb in 0 ms actionProductOutOfStock 0.00 Mb in 0 ms moduleRoutes 0.00 Mb in 0 ms displayMyAccountBlockfooter 0.00 Mb in 0 ms actionDispatcher 0.00 Mb in 0 ms actionFrontControllerSetMedia 0.00 Mb in 0 ms displayProductContent 0.00 Mb in 0 ms displayFooterProduct 0.00 Mb in 0 ms DisplayOverrideTemplate 0.00 Mb in 0 ms
Memory peak usage36.7 Mb
Execution Memory (Mb) Total (Mb) config 10.43 10.6 constructor 0.00 10.6 init 7.51 18.3 checkAccess 0.00 18.3 setMedia 0.21 18.4 postProcess 0.00 18.4 initHeader 0.01 18.4 initContent 15.29 33.8 initFooter 1.12 34.9 display 1.63 36.7
Total cache size (in Cache class)0.00 Mb
DB type: DbPDO
SQL Queries81 queries
Time spent querying63 ms
Included files: 277
Size of included files4.21 Mb
Globals (> 1 Ko only): 693 Ko
  • _MODULES ≈ 322.3 Ko
  • _LANG ≈ 198.8 Ko
  • context ≈ 139.2 Ko
  • _SERVER ≈ 10.6 Ko
  • _ENV ≈ 9.8 Ko
  • _MODULE ≈ 3.8 Ko
  • _REQUEST ≈ 2.2 Ko
  • _COOKIE ≈ 2.2 Ko
Edited by Hasher (see edit history)
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

a jak mogę sprawdzić który plik/funkcja wykonuje się tak długo? albo przynajmniej który moduł?
na pewno dużo czasu zajmuje wczytanie ostatnio dodanych produktów na stronie głównej, ale to już domyślny moduł Presty >.>

Link to comment
Share on other sites

  • 0

lokalizacja_sklepu\config\defines.inc i zmienną:

define('_PS_DEBUG_PROFILING_', false);

zmień false na true.

 

btw. powiem wam że przeniosłem się z home.pl na VPS microhosta z 2GB ramu i czas wykonania zmniejszył się z 2-8 sekund do 0.5-1 sekundy.

Link to comment
Share on other sites

  • 0

Moj sklep tez się długo wczytuje, ale własnie czasem, nie zawsze i nie wiem czy to jest spowodowane serverem czy prestą

 

Load time: 1817 ms
You'd better run your shop on a toaster
Execution Load time (ms) config 149 constructor 0 init 49 checkAccess 0 setMedia 3 postProcess 0 initHeader 0 initContent 1263 initFooter 13 display 339
 
Hook processing: 1283 ms / 12.98 Mb
68 methods called in 39 modules
Hook Processing displayHome 4.03 Mb in 1064 ms displayHeader 7.68 Mb in 164 ms displayTop 0.62 Mb in 22 ms displayFooter 0.27 Mb in 12 ms displayHomeTabContent 0.25 Mb in 7 ms displayHomeTab 0.03 Mb in 5 ms displayNav 0.04 Mb in 4 ms displayTopColumn 0.04 Mb in 4 ms moduleRoutes - Mb in 0 ms DisplayOverrideTemplate - Mb in 0 ms actionFrontControllerSetMedia - Mb in 0 ms displayBanner - Mb in 0 ms actionDispatcher - Mb in 0 ms
Memory peak usage: 22.2 Mb
Execution Memory (Mb) Total (Mb) config 5.88 6.0 constructor - 6.0 init 1.99 7.9 checkAccess - 7.9 setMedia 0.12 8.0 postProcess - 8.0 initHeader - 8.0 initContent 12.64 20.9 initFooter 0.28 21.1 display 0.58 22.2
Total cache size in Cache class: - Mb
Smarty cache: enabled
Smarty compilation: auto
SQL Queries: 355 queries in 884 ms
Included files: 240 (4.19 Mb)
Global vars : 0.41 Mb
  • $_MODULES ≈ 248k
  • $_LANG ≈ 130k
  • $context ≈ 34k
  • $_SERVER ≈ 4k
  • $_MODULE ≈ 3k

---------------------------------------------------------------------------------------------------------------

Stopwatch (with SQL_NO_CACHE) (total = 355)

Query Time (ms) Rows Filesort Group By Location
SELECT SQL_NO_CACHE p.id_product,  MAX(product_attribute_shop.id_product_attribute) id_product_attribute, pl.`link_rewrite`, pl.`name`, pl.`description_short`, product_shop.`id_category_default`,MAX(image_shop.`id_image`) id_image, il.`legend`,ps.`quantity` AS sales, p.`ean13`, p.`upc`, cl.`link_rewrite` AS category, p.show_price, p.available_for_order, IFNULL(stock.quantity, 0) as quantity, p.customizable,IFNULL(pa.minimal_quantity, p.minimal_quantity) as minimal_quantity, stock.out_of_stock,product_shop.`date_add` > "2015-06-25" as new,product_shop.`on_sale`, MAX(product_attribute_shop.minimal_quantity) AS product_attribute_minimal_quantityFROM `ps_product_sale` psLEFT JOIN `ps_product` p ON ps.`id_product` = p.`id_product`INNER JOIN ps_product_shop product_shopON (product_shop.id_product = p.id_product AND product_shop.id_shop = 1)LEFT JOIN `ps_product_attribute` paON (p.`id_product` = pa.`id_product`)LEFT JOIN ps_product_attribute_shop product_attribute_shopON (product_attribute_shop.id_product_attribute = pa.id_product_attribute AND product_attribute_shop.id_shop = 1 AND product_attribute_shop.`default_on` = 1)LEFT JOIN ps_stock_available stockON (stock.id_product = p.id_product AND stock.id_product_attribute = IFNULL(`product_attribute_shop`.id_product_attribute, 0) AND stock.id_shop = 1  AND stock.id_shop_group = 0  )LEFT JOIN `ps_product_lang` plON p.`id_product` = pl.`id_product`AND pl.`id_lang` = 1 AND pl.id_shop = 1 LEFT JOIN `ps_image` i ON (i.`id_product` = p.`id_product`) LEFT JOIN ps_image_shop image_shopON (image_shop.id_image = i.id_image AND image_shop.id_shop = 1 AND image_shop.cover=1)LEFT JOIN `ps_image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = 1)LEFT JOIN `ps_category_lang` clON cl.`id_category` = product_shop.`id_category_default`AND cl.`id_lang` = 1 AND cl.id_shop = 1 JOIN `ps_category_product` cp ON (cp.`id_product` = p.`id_product`)JOIN `ps_category_group` cg ON (cp.id_category = cg.id_category AND cg.`id_group` = 1)WHERE product_shop.`active` = 1AND p.`visibility` != 'none'GROUP BY product_shop.id_productORDER BY sales DESCLIMIT 0, 8
375 278 Yes   in prestashop/classes/ProductSale.php:187
from /modules/ganalytics/ganalytics.php:402
from /classes/Hook.php:512
from /tools/profiling/Hook.php:60
from /controllers/front/IndexController.php:40
from /tools/profiling/Controller.php:171
from /classes/Dispatcher.php:373
from /index.php:28
SELECT SQL_NO_CACHE p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`,pl.`meta_keywords`, pl.`meta_title`, pl.`name`, pl.`available_now`, pl.`available_later`, MAX(image_shop.`id_image`) id_image, il.`legend`, m.`name` AS manufacturer_name,product_shop.`date_add` > "2015-06-25" as new, MAX(product_attribute_shop.minimal_quantity) AS product_attribute_minimal_quantity,MAX(product_attribute_shop.id_product_attribute) id_product_attributeFROM `ps_product` pINNER JOIN ps_product_shop product_shopON (product_shop.id_product = p.id_product AND product_shop.id_shop = 1)LEFT JOIN `ps_product_lang` `pl` ON p.`id_product` = pl.`id_product`AND pl.`id_lang` = 1 AND pl.id_shop = 1 LEFT JOIN `ps_image` `i` ON i.`id_product` = p.`id_product`LEFT JOIN ps_image_shop image_shopON (image_shop.id_image = i.id_image AND image_shop.id_shop = 1 AND image_shop.cover=1)LEFT JOIN `ps_image_lang` `il` ON i.`id_image` = il.`id_image` AND il.`id_lang` = 1LEFT JOIN `ps_manufacturer` `m` ON m.`id_manufacturer` = p.`id_manufacturer`JOIN ps_category_product cp ON (cp.id_product = p.id_product)JOIN ps_category_group cg ON (cg.id_category = cp.id_category)LEFT OUTER JOIN `ps_product_attribute` pa ON p.`id_product` = pa.`id_product`LEFT JOIN ps_product_attribute_shop product_attribute_shopON (product_attribute_shop.id_product_attribute = pa.id_product_attribute AND product_attribute_shop.id_shop = 1 AND product_attribute_shop.default_on = 1)LEFT JOIN ps_stock_available stockON (stock.id_product = p.id_product AND stock.id_product_attribute = IFNULL(`product_attribute_shop`.id_product_attribute, 0) AND stock.id_shop = 1  AND stock.id_shop_group = 0  )WHERE (product_shop.`active` = 1) AND (product_shop.`visibility` IN ("both", "catalog")) AND (product_shop.`date_add` > "2015-06-25") AND (cg.`id_group` = 1)GROUP BY product_shop.id_productORDER BY p.`date_add` DESCLIMIT 10
236.4 92 Yes   in prestashop/classes/Product.php:2173
from /modules/ganalytics/ganalytics.php:393
from /classes/Hook.php:512
from /tools/profiling/Hook.php:60
from /controllers/front/IndexController.php:40
from /tools/profiling/Controller.php:171
from /classes/Dispatcher.php:373
from /index.php:28
SELECT SQL_NO_CACHE p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, MAX(product_attribute_shop.id_product_attribute) id_product_attribute, MAX(product_attribute_shop.minimal_quantity) AS product_attribute_minimal_quantity, pl.`description`, pl.`description_short`, pl.`available_now`,pl.`available_later`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, MAX(image_shop.`id_image`) id_image,MAX(il.`legend`) as legend, m.`name` AS manufacturer_name, cl.`name` AS category_default,DATEDIFF(product_shop.`date_add`, DATE_SUB(NOW(),INTERVAL 20DAY)) > 0 AS new, product_shop.price AS orderpriceFROM `ps_category_product` cpLEFT JOIN `ps_product` pON p.`id_product` = cp.`id_product`INNER JOIN ps_product_shop product_shopON (product_shop.id_product = p.id_product AND product_shop.id_shop = 1)LEFT JOIN `ps_product_attribute` paON (p.`id_product` = pa.`id_product`)LEFT JOIN ps_product_attribute_shop product_attribute_shopON (product_attribute_shop.id_product_attribute = pa.id_product_attribute AND product_attribute_shop.id_shop = 1 AND product_attribute_shop.`default_on` = 1)LEFT JOIN ps_stock_available stockON (stock.id_product = p.id_product AND stock.id_product_attribute = IFNULL(`product_attribute_shop`.id_product_attribute, 0) AND stock.id_shop = 1  AND stock.id_shop_group = 0  )LEFT JOIN `ps_category_lang` clON (product_shop.`id_category_default` = cl.`id_category`AND cl.`id_lang` = 1 AND cl.id_shop = 1 )LEFT JOIN `ps_product_lang` plON (p.`id_product` = pl.`id_product`AND pl.`id_lang` = 1 AND pl.id_shop = 1 )LEFT JOIN `ps_image` iON (i.`id_product` = p.`id_product`) LEFT JOIN ps_image_shop image_shopON (image_shop.id_image = i.id_image AND image_shop.id_shop = 1 AND image_shop.cover=1)LEFT JOIN `ps_image_lang` ilON (image_shop.`id_image` = il.`id_image`AND il.`id_lang` = 1)LEFT JOIN `ps_manufacturer` mON m.`id_manufacturer` = p.`id_manufacturer`WHERE product_shop.`id_shop` = 1AND cp.`id_category` = 2 AND product_shop.`active` = 1 AND product_shop.`visibility` IN ("both", "catalog") GROUP BY product_shop.id_product ORDER BY cp.`position` ASCLIMIT 0,10
133.6 114 Yes   in prestashop/classes/Category.php:708
from /modules/ganalytics/ganalytics.php:385
from /classes/Hook.php:512
from /tools/profiling/Hook.php:60
from /controllers/front/IndexController.php:40
from /tools/profiling/Controller.php:171
from /classes/Dispatcher.php:373
from /index.php:28
SELECT SQL_NO_CACHE h.id_hook, h.name as h_name, title, description, h.position, live_edit, hm.position as hm_position, m.id_module, m.name, activeFROM `ps_hook` hINNER JOIN `ps_hook_module` hm ON (h.id_hook = hm.id_hook AND hm.id_shop = 1)INNER JOIN `ps_module` as m ON (m.id_module = hm.id_module)ORDER BY hm.position
4.6 87 Yes   in /prestashop/classes/Hook.php:228
from /classes/Hook.php:266
from /classes/tax/TaxManagerFactory.php:67
from /classes/tax/TaxManagerFactory.php:47
from /classes/Product.php:2809
from /classes/Product.php:2682
from /classes/Product.php:3951
from /classes/Product.php:4080
from /classes/Category.php:716

 

 

Akurat przy tym tescie weszło w niecaly 2s, ale nie bardzo umię wszytko rozszyfrować czy wszystko ok?

 

akualnie mam (http://www.hekko.pl/serwery_vps.html) - MediumOpenVZ

jest na min 2 sklepy presty (1.6), aplikacja php do magazynu mała (23 tabel(a) Suma 175 297 InnoDB   5,7 MB)

i hurtownia jako sklep presty 1.5, ale na to nikt nie wchodzi, pojedynczy dostawcy

 

I czy musze szukać problemu w serverze czy coś ze strona? ta druga strona (1.6) też się słabo wczytuje.

Proszę o sugestie zwiazane z danymi które wypisałem z testu czy tam coś jest.

 

Edited by paplo22 (see edit history)
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...