letall Posted April 2, 2010 Share Posted April 2, 2010 Hi PeopleWe are new here, but our site was built with prestashop but its so so so slow, the site takes on average 30 seconds to load and then once your in the search can take atleast a min to show anything,We do have a rather large 200k product database, but i was assured prestashop can cope with this.We are on a shared server, and the host has confirmed theres is no overload on the server or anything, so i am stuck what could be causing this to be so damn slow.http://www.insideanglia.co.uk/e-shop/prestashop/index.phpany help greatfully received Link to comment Share on other sites More sharing options...
tomerg3 Posted April 2, 2010 Share Posted April 2, 2010 It's most likely this is caused by slow database queries, I have noticed quite a few slow queries that are happening when there are many products, but I have yet to come across a shop with 200,000 products.I'll be happy to take a look and see if I can find / speed up those queries.If you PM me your ftp info, I will look at the slow queries log (I will need access to the root folder since the slow mysql queries are usually in a tmp folder there) Link to comment Share on other sites More sharing options...
anson.c Posted June 21, 2010 Share Posted June 21, 2010 Hi tomerg3,I too find my site running slow. I can't really figure out what is the real problem but suspecting the same database queries issue. However I don't have access to mysql log. Any suggestion you can give me? Thanks! Link to comment Share on other sites More sharing options...
tomerg3 Posted June 21, 2010 Share Posted June 21, 2010 Maybe, if I know what it is (URL) or more info about it (# of products, categories, and special modules installed).... Link to comment Share on other sites More sharing options...
anson.c Posted June 21, 2010 Share Posted June 21, 2010 My url is www.ecyclog.comI have about 1000 products and 50 categories. Some regular modules and that's about it. Link to comment Share on other sites More sharing options...
rocky Posted June 21, 2010 Share Posted June 21, 2010 The reason your website is slow is because you have many categories in the category block that are all being loaded at once. Google Chrome tells me that 15 seconds of your website load time is caused by loading the HTML document, then 5 seconds for images, 3.7 seconds for scripts and 1.3 seconds for CSS. I suggest that you this free module to remove the Smarty templates from the category module, or use my paid AJAX Sliding Categories module to load the top-level categories only and dynamically load the remaining ones. Link to comment Share on other sites More sharing options...
anson.c Posted June 21, 2010 Share Posted June 21, 2010 Thanks rocky!I already have the free module installed couple days ago. I saw a bit of improvement at first but then it came back to normal (or even slower). It's weird. Link to comment Share on other sites More sharing options...
Marc Posted June 21, 2010 Share Posted June 21, 2010 BonjourRegarde là http://www.prestashop.com/bug_tracker/view/4747/Je pense que c'est le même problème Link to comment Share on other sites More sharing options...
anson.c Posted June 22, 2010 Share Posted June 22, 2010 Hmm... now I found homefeatured module may too cause the slowness as I have many products set to "home" and will display 8 of them each time. Link to comment Share on other sites More sharing options...
anson.c Posted June 26, 2010 Share Posted June 26, 2010 I edited the homefeatured.php so it wont' load all 1000 products everytime.I putted a rand() on line 69: $products = $category->getProducts(intval($params['cookie']->id_lang), 0, rand()&1000;+8);It picks a random number from the range of 1000 then +8 just in cause the random number is less than 8.Don't know if it's the best way as I'm no expert but it seems to load a bit faster now.I also want to know what that number do (e.g. 0) before the rand()? It seems like limiting the home featured into certain category. homefeatured.zip Link to comment Share on other sites More sharing options...
rocky Posted June 26, 2010 Share Posted June 26, 2010 The parameter is the page number, which is used in the pagination feature. It is multiplied with the number of products in the third parameter to get the products relevant to the current page only. Link to comment Share on other sites More sharing options...
anson.c Posted June 27, 2010 Share Posted June 27, 2010 Cool rocky! THanks for answering my question again. LOLI'm not sure if I wrote the code right because sometimes I will get no featured products displayed? Link to comment Share on other sites More sharing options...
rocky Posted June 28, 2010 Share Posted June 28, 2010 Try the following instead: $products = $category->getProducts(intval($params[‘cookie’]->id_lang), rand(1, 125), 8); This will choose a random page of 8 products between 1 and 125 (assuming you have exactly 1000 products). Link to comment Share on other sites More sharing options...
anson.c Posted June 29, 2010 Share Posted June 29, 2010 Thanks rocky, that's a good idea!However, it will select 8 (sequenced) products out of a random page. I'm trying to see if it's possible to get 8 random products out of different pages (but not requesting a thousand from the database). Link to comment Share on other sites More sharing options...
anson.c Posted June 29, 2010 Share Posted June 29, 2010 How about this? $n = rand(1,5); $products = $category->getProducts(intval($params['cookie']->id_lang), $n, 200); Link to comment Share on other sites More sharing options...
rocky Posted June 30, 2010 Share Posted June 30, 2010 I just realised that there is actually a random parameter built in to PrestaShop. I forgot about it when I posted above. Try the following instead: $category->getProducts(intval($params['cookie']->id_lang), 1, 8, NULL, NULL, false, true, true, 8); Link to comment Share on other sites More sharing options...
anson.c Posted June 30, 2010 Share Posted June 30, 2010 That is GREAT!!!Now I can see my homepage loading faster.I'm going to make a new topic and post the whole module for everyone and credit to Mr. Rocky!! Link to comment Share on other sites More sharing options...
epicurean Posted September 16, 2010 Share Posted September 16, 2010 Hi We are having the same problem. Our webstie is very very slow, I have found various solutions, we are a bit overwhelmed, where would you suggest we start?thank you Phyllis www.epicureanfoods.com Link to comment Share on other sites More sharing options...
jdmorrisn Posted October 7, 2010 Share Posted October 7, 2010 I know this is an old thread and I don't know if it is monitored at all, but a quick question: My images in the home featured do display randomly but from one category - how can I make them show from multiple categories? Link to comment Share on other sites More sharing options...
Recommended Posts