Jump to content

So So So So Slow and i cant figure why!


Recommended Posts

Hi People

We 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.php

any help greatfully received

Link to comment
Share on other sites

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

  • 2 months later...

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

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

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

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

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

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

  • 2 months later...
  • 3 weeks later...
×
×
  • Create New...