This site is now 100% read-only, and retired.

XML logo

OpenCart Performance
Posted by simonw on Wed 6 Mar 2013 at 15:27
Tags: none.
Wrestled OpenCart in anger today for the first time.

Linkchecked a site and our server died under the load, added "--pause=1" to linkchecker - same result.

On inspection of mysql-slow-log it was taking a long time to count the products in a given category (0.43s).

Various people offer the fix of switching off the category counts when I searched, but I figured something was wrong at the database level since a simple count like that should be pretty much instantaneous in a modern database with only ~40,000 records (and three products in the category I was testing). Some sniffing around got me to:

https://github.com/opencart/opencart/issues/177.

So:

create index iproduct_description_language_id on product_description ( language_id );
create index iproduct_to_category_category_id on product_to_category ( category_id);

Now the problem query has gone from 0.43s to 0.00s - possibly the default precision of the MySQL timer will need addressing as Moore's law continues.

This was day one with OpenCart, this issue doesn't full me with confidence, or did the guy who installed it miss something?