Jump to content

Very slow products deleting and overall performance


Recommended Posts

I get very slow response when deleting (and importing) products on my own server.
I am working on new installation of of PrestaShop 1.5.5.0 and I set debugging info:

define('_PS_DEBUG_PROFILING_', true);

I get debug info as seen from the attached image ('debug.jpg'). But real time my server spend for deleting 5 products is around 1-2 minutes and I really can't understand where the problem is!

 

The facts regarding my server:

- I don't get any severe CPU, memory or HDD utilization when doing "product delete",

- mySQL database seems to work fast and fine, i.e. I tested it with manual .php and SELECT/UPDATE statements,

- my PrestaShop only got 100 products with just few images and up 1024chars of text per product,

- I have full control over my server (win7 x64 & WAMP server), so I also set some other performance variables, like memory_limit, etc.

- my server is in TESTING environment, so there is no customers on my site, so this may not be an issue.

 

What else can I check/set to get faster, i.e. "normal" response time?

post-728767-0-90257200-1385115945_thumb.jpg

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...

I investigated slow detele and the root cause for my environment is InnoDB engine which mysql is using and prestashop is using by default.

 

First I suspected slow queries.

 

There are MANY queries when you delete one product. And also to correct the position I see hundreds or more of these taking all long time (first value in seconds)

 

0.4297:UPDATE `ps_category_product` SET `position` = '0' WHERE `id_category` = 107 AND `id_product` = 1328
======
0.1726:UPDATE `ps_category_product` SET `position` = '1' WHERE `id_category` = 107 AND `id_product` = 1346
======
0.0882:UPDATE `ps_category_product` SET `position` = '2' WHERE `id_category` = 107 AND `id_product` = 1348
======
0.4659:UPDATE `ps_category_product` SET `position` = '3' WHERE `id_category` = 107 AND `id_product` = 1376
 

Then I dig into the code and see this comment:

// Deleting products can be quite long on a cheap server. Let's say 1.5 seconds by product (I've seen it!).

 
I can tell you I don't have a cheap server... 
 
Then I discovered that mysql is very slow for delete/update/insert when using InnoDB. 
 
I changed all tables to MyISAM and voila, no more LONGGGG delays. Maybe even 100 times faster!!
 
How I did:
Export your full database to an sql file (I use mysqldump, but can also be myphpadmin). Then first make a copy of the file (so you have a backup). Then replace "InnoDB" with "MyISAM" and  import again. 
 
Also my shop is faster again for normal usage (select). Maybe because I optimized the mysql server.
  • Like 2
Link to comment
Share on other sites

  • 1 month later...

The only solution for my HUGE database is to override cleanPositions

 

class Product extends ProductCore
{
public static function cleanPositions($id_category) 
{
LibTools::log_import("cleanPositions\n");
//do nothing.. sad to say..
}
}
Link to comment
Share on other sites

  • 4 months later...

Have this problem, it takes like a minute per product or even more to delete it. My server configuration is alright and i have almost no reachable limits on memory usage, timeout, etc... also, I didn't change anything from original core files (using PS 1.6.0.6).

Import CSV is also slower than what it should be, but ways quicker than deleting.

 

I would like to solve without tricks, in a clean way.

Edited by Nabbolo (see edit history)
Link to comment
Share on other sites

  • 9 months later...

Have this problem, it takes like a minute per product or even more to delete it. My server configuration is alright and i have almost no reachable limits on memory usage, timeout, etc... also, I didn't change anything from original core files (using PS 1.6.0.6).

Import CSV is also slower than what it should be, but ways quicker than deleting.

 

I would like to solve without tricks, in a clean way.

Hi, did you ever solve this issue? Thanks

Link to comment
Share on other sites

  • 1 year later...
×
×
  • Create New...