Jump to content

Prestashop uses excessive resources of the server


Guest Steven_king

Recommended Posts

The following information is from my host web technicist, and he stops Product.php and requests me to optimize the script of product.php.

“The error “We’re sorry, but the Web address you entered is no longer available “ you are facing is due to the fact that the script product.php has been renamed product.php.disabled. This steps was taken, as your account was using excessive resources of the server.We advise you to please go though the script and optimize it to bring down the resource usage of your account. “

Since I don’t know much PHP,I need your suggestion to solve the problem.

Thank you Thank you very much!

My site is: [Fake website - Moderated by Patric]

Link to comment
Share on other sites

Hi Ardian,

Are u sure Prestashop is very light ?

Sometimes I feel the resources of my CPU is taken up much even when I open prestashop.com in my computer.

Can you please take a look at my site now and check if it takes up much resources in your computer.

I have renamed the Product.php and it is available.

Please help check it .Thank you very much!

Link to comment
Share on other sites

I have seen performance problems with a webshop that has more than 17000 products. I got a comment from the service provider stating that 3374026 rows was examined just to show the front page.

I traced it down to classes/Product.php and the method getNewProducts(). Perhaps this could be optimized by getting a list of the newest products first and then subsequently select/join as necessary?

/Kjeld

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...

Get new products get all products added within a selected number of days as I remember, so what you need to do is just change the number of days a product is considered "new" so that not ALL products in your shop is in the new products list. I think that should solve the problem for you.
you can change that in Administration - Settings - Product

Link to comment
Share on other sites

I just did a search over the entire Prestashop code for getNewProducts. The only files that use this function are new-products.php and modules/blocknewproducts/blocknewproducts.php. It is safe to delete this function as long as you also delete the files that use it. You will also need to remove the link to new-products.php in modules/blockvariouslinks/blockvariouslinks.tpl and sitemap.tpl in your theme's directory.

Link to comment
Share on other sites

I don't think this is an issue many people would have to worry about. It is only a problem if you are adding lots of products to your site in a short period of time, since they will all be marked as new products and included in the new products query. As ruilong point out above, the best solution is to go to Preferences > Products and change the "Number of days a product is considered 'new'" to a lower value, or 0 to disable new products altogether. After you've added all your products and waited a few days, if you will only be adding a small number of new products at a time, you can increase the value again to allow a few new products to appear in the new products block.

Link to comment
Share on other sites

  • 1 month later...
×
×
  • Create New...