Page 2 of 5

Re: What is the largest shop so far, any scaling issues?

Posted: Fri Mar 19, 2010 4:35 pm
by AndyGaskell
Shame that didn't work. I know some hosts put a hard cap on these things, perhaps you're hitting that. I've used OpenCart on the web hosts Canaca, and they had unmovable caps on memory and execution.

Re: What is the largest shop so far, any scaling issues?

Posted: Wed Mar 24, 2010 6:58 pm
by AndyGaskell
I've just noticed something with the big shop I'm working on just now, which I thought might be useful generally, so good to share.

I'd noticed slow loading times on my host's server, but ok loading times on my local dev server. The shop is about to go live so I thought I'd better have a look into. The shop has 18,000 products in ~300 categories, and the home page was taking sometimes 10 seconds to load, with only 10% of this being download time. The HTML sent to the user was 73KB, so a fair size, but not huge. Anyway, I've got the search module enabled, and that was generating quite a lot of HTML, as the "Search in a category:" select in the search module was creating and <option> for each category. Anyway, just as a test, I removed the category code from catalog/view/theme/mytemplate/template/module/search.tpl and catalog/controller/module/search.php, and the load times went down to 2-3 seconds, which is much better. HTML code is now 43KB, so that's better too.

This is OC 1.4.0, if I mention the name of the host, I think I'll get flamed, so I'll keep quiet on that one :)

Re: What is the largest shop so far, any scaling issues?

Posted: Fri Mar 26, 2010 4:36 am
by caspara
AndyGaskell wrote:I've just noticed something with the big shop I'm working on just now, which I thought might be useful generally, so good to share.

I'd noticed slow loading times on my host's server, but ok loading times on my local dev server. The shop is about to go live so I thought I'd better have a look into. The shop has 18,000 products in ~300 categories, and the home page was taking sometimes 10 seconds to load, with only 10% of this being download time. The HTML sent to the user was 73KB, so a fair size, but not huge. Anyway, I've got the search module enabled, and that was generating quite a lot of HTML, as the "Search in a category:" select in the search module was creating and <option> for each category. Anyway, just as a test, I removed the category code from catalog/view/theme/mytemplate/template/module/search.tpl and catalog/controller/module/search.php, and the load times went down to 2-3 seconds, which is much better. HTML code is now 43KB, so that's better too.

This is OC 1.4.0, if I mention the name of the host, I think I'll get flamed, so I'll keep quiet on that one :)
That is a great idea as I have many cats also. Would you mind to PM me with the revised search.php file?

Re: What is the largest shop so far, any scaling issues?

Posted: Fri Mar 26, 2010 9:11 am
by rph
AndyGaskell wrote:This is OC 1.4.0, if I mention the name of the host, I think I'll get flamed, so I'll keep quiet on that one :)
Only if it's GoDaddy. ;)

Boy are you right on the search categories. I just did a check on the live server with 350 categories and the front page load time was 11 seconds. Ouch!

It's definitely the search categories that are the issue. Remove the code and the long load time completely disappears. Maybe they aren't being loaded from the cache? I'll have to do some checking.
caspara wrote:That is a great idea as I have many cats also. Would you mind to PM me with the revised search.php file?
In /catalog/view/theme/[theme name]/template/common/header.tpl delete:

Code: Select all

            <select id="filter_category_id">
              <option value="0"><?php echo $text_category; ?></option>
              <?php foreach ($categories as $category) { ?>
              <?php if ($category['category_id'] == $category_id) { ?>
              <option value="<?php echo $category['category_id']; ?>" selected="selected"><?php echo $category['name']; ?></option>
              <?php } else { ?>
              <option value="<?php echo $category['category_id']; ?>"><?php echo $category['name']; ?></option>
              <?php } ?>
              <?php } ?>
            </select>

Re: What is the largest shop so far, any scaling issues?

Posted: Fri Mar 26, 2010 10:17 am
by rph
Looks like it does load the cache and it's the parsing that gets it in trouble.

Re: What is the largest shop so far, any scaling issues?

Posted: Fri Mar 26, 2010 11:23 am
by rph
This is really fugly but it appears to do the trick for caching the search category filter options. Tested lightly on 1.4.4.

/catalog/controller/common/header.php

Find

Code: Select all

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

Code: Select all

		if (!$this->cache->get('search.categories.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id'))) {
			$this->data['categories'] = $this->getCategories(0);
			
			$this->cache->set('search.categories.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id'), $this->data['categories']);
		} else {
			$this->data['categories'] = $this->cache->get('search.categories.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id'));
		}

Re: What is the largest shop so far, any scaling issues?

Posted: Fri Mar 26, 2010 9:41 pm
by Qphoria
Don't you still need to blow away that cache file when a new category is added?

Re: What is the largest shop so far, any scaling issues?

Posted: Sat Mar 27, 2010 8:03 am
by rph
Yeah, you're right.

Re: What is the largest shop so far, any scaling issues?

Posted: Mon Mar 29, 2010 2:10 pm
by rph
A little more complete/consistent code:

/catalog/controller/common/header.php
/catalog/controller/product/search.php

Replace

Code: Select all

$this->data['categories'] = $this->getCategories(0);
with

Code: Select all

		if ($this->cache->get('search.categories.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id'))) {
			$this->data['categories'] = $this->cache->get('search.categories.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id'));
		} else {
			$this->data['categories'] = $this->getCategories(0);
			
			$this->cache->set('search.categories.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id'), $this->data['categories']);
		}
/admin/model/catalog/category.php
public function addCategory
public function editCategory
public function deleteCategory

Replace:

Code: Select all

$this->cache->delete('category');
with

Code: Select all

$this->cache->delete('category');
$this->cache->delete('search.categories');
Thanks to Q for mentioning the missed bit.

Re: What is the largest shop so far, any scaling issues?

Posted: Wed Mar 31, 2010 12:59 am
by caspara
Excellent! Thanks Ryan. My site seems to load much more quickly now (results from http://www.webpagetest.org):

Before:

http://www.webpagetest.org/result/10032 ... 1/details/

After the above modification (and caching, GZipping js and css):

http://www.webpagetest.org/result/10033 ... 1/details/

I know it still isn't a great site speed, but I'm going to continue to improve it. Thanks again for your help.

Re: What is the largest shop so far, any scaling issues?

Posted: Sat Jan 29, 2011 2:51 pm
by cresela30
Hi… that was great stuff.. I really like this subject

Re: What is the largest shop so far, any scaling issues?

Posted: Fri Apr 15, 2011 12:46 am
by slawson17
That worked great! Thanks Ryan!!

Re: What is the largest shop so far, any scaling issues?

Posted: Fri May 27, 2011 7:56 am
by AndyGaskell
So, from this chat, the league table stands at, drum roll please...

datacon @ 100k
ibdesign @ 56k
caspara @ 40k
alleikis @ 27k
AndyGaskell @ 20k
tintedpixel @ 12k
airetechit @ 9k

...and the winner is, OpenCart, for scaling really nicely :)

Re: What is the largest shop so far, any scaling issues?

Posted: Fri Jun 10, 2011 10:10 pm
by onlinephilately
I have searched the forum for a hint to solve this in 1.5 but not found anything.

I have quite a lot of categories and when I have the enabled the site is very slow and when I disable the categories the site is lightning fast - so the issue is with the load of the categories.

Does anybody know if the cache functionality is included in 1.5 or not?

Re: What is the largest shop so far, any scaling issues?

Posted: Sun Jun 19, 2011 7:31 pm
by sguven
hi
im using opencart 1.5.05
i have 10.000 product in the database.
opencart is slow working why?
http://www.pintiyiz.com main root
http://www.pintiyiz.com/Bilgisayar a categorie opens in 11 seconds bad performance

products are added automatically with c #

please help me .

Re: What is the largest shop so far, any scaling issues?

Posted: Sun Jun 19, 2011 7:40 pm
by sguven

Re: What is the largest shop so far, any scaling issues?

Posted: Sun Jun 19, 2011 10:20 pm
by allaboutcake
I'm currently up around 13k on 1.4.9.3 moving to 15k products / images in a couple of weeks, use the Excel import / export mod, works fine at the moment - no real slowness to report although only get a 2 - 3 users on at any one time.

Re: What is the largest shop so far, any scaling issues?

Posted: Sun Jun 19, 2011 10:29 pm
by allaboutcake
sguven wrote:hi
im using opencart 1.5.05
i have 10.000 product in the database.
opencart is slow working why?
http://www.pintiyiz.com main root
http://www.pintiyiz.com/Bilgisayar a categorie opens in 11 seconds bad performance

products are added automatically with c #

please help me .
Your's opened in about 6 seconds for me, which is around about the same time as mine :-)

Re: What is the largest shop so far, any scaling issues?

Posted: Sun Jun 19, 2011 10:33 pm
by onlinephilately
I think this is too slow...

Has anybody found out if the solution above with cache of categories will speed up load?

Re: What is the largest shop so far, any scaling issues?

Posted: Mon Jun 20, 2011 12:59 am
by sguven
install the old version ?

How many products you have installed?