Post by tkambler » Fri Jul 16, 2010 11:19 pm

I've recently finished installing OpenCart. I now have a product database consisting of 80,000 products. The site is suffering from extreme slowness, as in taking one minute or more to simply load the home page.

Can anyone provide some insight, recommendations, etc... for a way to fix this? Anyone else faced this problem?

Thanks!

Newbie

Posts

Joined
Tue Jul 13, 2010 10:38 am

Post by JAY6390 » Fri Jul 16, 2010 11:37 pm

Opencart isn't really designed for holding such large amounts of products

My biggest question for you is what hosting do you have? shared, vps, or dedicated?

ImageImageImage

SEO MEGA KIT PLUS - Get your site ranking higher in the search engines
Better Product SEO URL's - Perfectly structured product links
SEO URL's Route Editor PRO - Make ANY url on your site have clean keywords - even third party extensions (remove index.php)


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by fido-x » Fri Jul 16, 2010 11:53 pm

tkambler wrote:I've recently finished installing OpenCart. I now have a product database consisting of 80,000 products.
Wow! 80,000 products. Great testament for OpenCart!
JAY6390 wrote:Opencart isn't really designed for holding such large amounts of products
Probably more a case of "no-one expected OpenCart could hold so many products", than a design issue.
JAY6390 wrote:My biggest question for you is what hosting do you have? shared, vps, or dedicated?
I agree. This is the REAL issue! Using a dedicate host should speed things up.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by JAY6390 » Sat Jul 17, 2010 12:23 am

Yeah even stores with smaller amounts like 10,000 should be on dedicated. OC needs some major tweaking in a few areas when it comes to queries for the database, and processing results

ImageImageImage

SEO MEGA KIT PLUS - Get your site ranking higher in the search engines
Better Product SEO URL's - Perfectly structured product links
SEO URL's Route Editor PRO - Make ANY url on your site have clean keywords - even third party extensions (remove index.php)


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by Xsecrets » Sat Jul 17, 2010 1:53 am

how many categories? I see no reason why opencart couldn't handle that many products. There are two performance bottle necks that I know of.
1) if you have lots of categories the categories dropdown next to the search can slow things down. you can try removing this.
and
2) add indexes to product_id in product_special, product_review, and product_discount tables. the site where I saw this problem it was mostly from the specials box. I disabled the specials box and the site sped up tremendously, so if you disable specials and the site speeds up try adding the indexes, you'll most likely need them anyways with that many products.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by tkambler » Sat Jul 17, 2010 5:50 am

Thanks for all of the input, everyone. To answer your questions...

Dedicated hosting. Quad core, 2.4GHz, 4GB Ram, etc...

And yes, there are a ton of categories. 841 to be exact.

Xsecrets: I will followup on your recommendation to add indexes and perhaps hard-code the category drop-down by the search box and get back to you.

Newbie

Posts

Joined
Tue Jul 13, 2010 10:38 am

Post by JAY6390 » Sat Jul 17, 2010 5:55 am

You could just cache it instead of hard coding it

ImageImageImage

SEO MEGA KIT PLUS - Get your site ranking higher in the search engines
Better Product SEO URL's - Perfectly structured product links
SEO URL's Route Editor PRO - Make ANY url on your site have clean keywords - even third party extensions (remove index.php)


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by tkambler » Sat Jul 17, 2010 6:02 am

A little bit of background... You would not believe how much time I spent perfecting a process that would allow me to import all of our product data, options, etc... into Magento. But by the time I had finally gotten it done, Magento became incredibly slow. Completely, unusably slow.

After taking one look at OP's db schema, I was able to put together an import process within 30 minutes. The same process for Magento took 12+ hours.

Newbie

Posts

Joined
Tue Jul 13, 2010 10:38 am

Post by JAY6390 » Sat Jul 17, 2010 6:13 am

Yeah Magento is a bit of a nightmare, and extremely cpu intensive

ImageImageImage

SEO MEGA KIT PLUS - Get your site ranking higher in the search engines
Better Product SEO URL's - Perfectly structured product links
SEO URL's Route Editor PRO - Make ANY url on your site have clean keywords - even third party extensions (remove index.php)


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by Xsecrets » Sat Jul 17, 2010 11:14 am

well let us know how it goes. Like I said there may be some bottlenecks here and there, but opencart shouldn't be too hard to make work very quickly with this number of products.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by i2Paq » Sat Jul 17, 2010 2:56 pm

I know that there are issues when you have the search option in your header.

I've got the following from zrxraver over on the Dutch forums:

Caching of categories:

in catalog/controller/common/header.php

Find:

Code: Select all

$this->data['categories'] = $this->getCategories(0);
  
Replace by:

Code: Select all

    $category_tree_data = $this->cache->get('categories.0');
        if(!$category_tree_data) {
          $category_tree_data = $this->getCategories(0);
          $this->cache->set('categories.0', $category_tree_data);
        }
        $this->data['categories'] = $category_tree_data;
  

in catalog/controller/product/search.php

Find :

Code: Select all

$this->data['categories'] = $this->getCategories(0);        
  
Replace by:

Code: Select all

        $category_tree_data = $this->cache->get('categories.0');
        if(!$category_tree_data) {
          $category_tree_data = $this->getCategories(0);
          $this->cache->set('categories.0', $category_tree_data);
        }
        $this->data['categories'] = $category_tree_data;
  
in system/cache/ you will find a file called cache.categories.0.....

Disclaimer: Use this at your own risk, I have not tested this myself (yet).

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by JAY6390 » Sat Jul 17, 2010 8:32 pm

You will of course need to delete the cache when you edit any of the category items

ImageImageImage

SEO MEGA KIT PLUS - Get your site ranking higher in the search engines
Better Product SEO URL's - Perfectly structured product links
SEO URL's Route Editor PRO - Make ANY url on your site have clean keywords - even third party extensions (remove index.php)


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by tkambler » Wed Jul 21, 2010 2:16 pm

OK, I have tried all of these suggestions, and it does seem to have helped. My category and product pages now load very quickly. Basically everything loads very fast with the exception of the home page. The home page regularly takes upwards of 20 seconds to load.

Can anyone provide any insight into what may be happening specifically on the home page that is causing OpenCart to slow down so badly with so many products?

Thank you for all your help!

Newbie

Posts

Joined
Tue Jul 13, 2010 10:38 am

Post by Xsecrets » Wed Jul 21, 2010 9:03 pm

if everthing loads quickly but the homepage I would disable any module that you have set to the home position one by one and check each time to see if it speeds up. If you can pinpoint it to a module then we can go from there.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Qphoria » Wed Jul 21, 2010 9:22 pm

I will add the category dropdown cache to 1.4.9

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by maxmas » Fri Sep 24, 2010 1:36 pm

Qphoria wrote:I will add the category dropdown cache to 1.4.9
Hi Qphoria,

You did not add the category dropdown cache to 1.4.9.1.
Do you forgot it?

Newbie

Posts

Joined
Fri Sep 24, 2010 1:10 pm

Post by 123adk » Sun Oct 17, 2010 11:55 am

How do i add indexes to speed up the loading of my opencart website?

Newbie

Posts

Joined
Tue Aug 24, 2010 11:48 pm

Post by tuba » Tue Jun 28, 2011 6:42 am

Hi All,
I wonder if anyone used open cart with more categories? I have 6000 categories and the site just dies... loads so slow that it can not be used.
You wonder why I have 6000 categories? Well simple:
Car Store:
>>Car brand BMW
>>SUBCATS BMW 1 BMW 2 etc..
SUBSUBCATS Breaks, Parts etc 20 of them
So you can easily run up to 6-10000 categories at which it seems open cart can not work. Or is there anyone who has so many categories and the site still works?

Newbie

Posts

Joined
Sat Sep 04, 2010 7:11 am

Post by naugtur » Thu Aug 25, 2011 5:54 pm

I work with a team and we build an OpenCart based solution that requires about 10000 categories. See my post in

"What is the largest shop so far, any scaling issues?" http://forum.opencart.com/viewtopic.php ... 54#p189354

Newbie

Posts

Joined
Thu Aug 25, 2011 5:42 pm

Post by chrisg42 » Tue Mar 06, 2012 9:30 am

We're running OpenCart with 32,000 products in 63 categories.

The extreme slowness for us came from all the calls to getTotalProducts to display the total products in each category. After removing these calls the page load time became reasonable (about 2 secs).

In catalog/controller/common/header.php
search for

Code: Select all

					$product_total = $this->model_catalog_product->getTotalProducts($data);
									
					$children_data[] = array(
						'name'  => $child['name'] . ' (' . $product_total . ')',
						'href'  => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'])	
					);	
and replace with

Code: Select all

					$children_data[] = array(
						'name'  => $child['name'],
						'href'  => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'])	
					);	
and in catalog/controller/module/category.php

Code: Select all

$product_total = $this->model_catalog_product->getTotalProducts($data);
							
				$children_data[] = array(
					'category_id' => $child['category_id'],
					'name'        => $child['name'] . ' (' . $product_total . ')',
					'href'        => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'])	
				);

and replace with

Code: Select all

$children_data[] = array(
					'category_id' => $child['category_id'],
					'name'        => $child['name'],
					'href'        => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'])	
				);
and also in catalog/controller/module/category.php search for

Code: Select all

$product_total = $this->model_catalog_product->getTotalProducts($data);
						
			$this->data['categories'][] = array(
				'category_id' => $category['category_id'],
				'name'        => $category['name'] . ' (' . $product_total . ')',
				'children'    => $children_data,
				'href'        => $this->url->link('product/category', 'path=' . $category['category_id'])
			);
replace with

Code: Select all

$this->data['categories'][] = array(
				'category_id' => $category['category_id'],
				'name'        => $category['name'],
				'children'    => $children_data,
				'href'        => $this->url->link('product/category', 'path=' . $category['category_id'])
			);
If you have heaps of categories adding an index to category.parent_id will also help to speed things up.

User avatar
Newbie

Posts

Joined
Sun Oct 30, 2011 2:06 pm

Who is online

Users browsing this forum: No registered users and 13 guests