Page 1 of 1

Opencart too slow - cache or another solution?

Posted: Thu Jul 01, 2010 5:33 am
by VHalek
Hi, I've got about 300 categories and about 500 products in my Opencart store, but I think it's reason why my Opencart started to be very slow (also in admin panel).
Do you know about any cache fix or another solution how to make it faster?

Re: Opencart too slow - cache or another solution?

Posted: Thu Jul 01, 2010 3:07 pm
by i2Paq
And on what kind of server/os is OC running?
Your sure that the problem is not caused by your server?

Check you provider setup/plan and ask you hoster as well.

Re: Opencart too slow - cache or another solution?

Posted: Thu Jul 01, 2010 5:08 pm
by VHalek
You're right that there is a possibility the problem is not on my side. But I wrote to my webhoster and they (as I expected) replied that their server is OK. But it's true that from this conversation with them I think it's little bit faster than before, but it's still not so fast as I want.

I also tried GZIP, but if I set there any other number than zero, the page "checkout/cart" doesn't work.

I've read on this forum that there are some solutions connected with cache fix, but I couldn't find any topic with more information...

Re: Opencart too slow - cache or another solution?

Posted: Thu Jul 01, 2010 7:15 pm
by Qphoria
"doesn't work" doesn't help
The compression should work fine unless you have other errors.
If you have 300 categories, you may have an issue with the dropdown category search box. There is a cache example by rph to improve that. We will look into adding that to the core to improve things. Other than that, there is a lot caching already in place and OpenCart is one of the fastest carts around

Re: Opencart too slow - cache or another solution?

Posted: Thu Jul 01, 2010 8:23 pm
by Daniel
post a link to your site please.

Re: Opencart too slow - cache or another solution?

Posted: Tue May 31, 2011 11:39 am
by benlhe
Hi pro,
I am fresh & with very little knowledge on coding, I encounter the same problem, I contacted my hosting co. they said server is running fine, it probably due to my own internet connection. But I was able to browse other websites smoothly only my site was lag on loading..... any solution or catch / something I can do to speed it up ???

This is my site with about 350 products --> http://www.qqbox.my
Thanks

Re: Opencart too slow - cache or another solution?

Posted: Thu Jul 07, 2011 2:41 pm
by crazy_larva
The problem is 100% in category amount.
I have to develop an internet store that has about 2500 categories (12 categories, 124subcategories and 2400 subsubcategories). I imported them without products and my webserver crashed. I began to test performance, it worked fine with 100 categories, but with 500 of them apache consumed almost 100% of processor time and it took about 5 seconds to navigate from one to another. I'm going to tweak my apache\php config files today for better performance, but I'm afraid it will work very slow anyway with even a few visitors.
If anyone found a way to solve this problem - please post your solution

Re: Opencart too slow - cache or another solution?

Posted: Tue Sep 13, 2011 11:02 pm
by kalexan
Hello.

I have being using version 1.4.9.X quite some time.

OpenCart is really well written in terms of code but there are majour performance issues when you need to use friendly URLs. That is because whenever a link to a product or category is displayed, even if the data is cached by the OC's intrernal caching engine, OC's code accesses the database to get the friendly URL.

For example, at a webstore that I use a flyout menu for categories' navigation (all category tree is loaded/displayed), without friendly URLs activated , 40-60 queries are needed. With friendly URLs activated, 800-1000 queries per page view!

Also consider that, when categories or lists of products are displayed, each generated link needs one query to get the friendly URL, so the more products displayed on a single page, the more queries needed to get friendly URLS.

Friendly URLs code must be rewritten for sure! I will try to mess things up a bit and will let you know...

Re: Opencart too slow - cache or another solution?

Posted: Fri Dec 16, 2011 9:38 am
by netpox
I have also experienced slow performance. I have about 50 main categories that have 120 sub-categories and then each one of those has 15 more categories inside. So there are 1800 subcategories inside the main categories. It's slow and crashes the site all the time. If i login to the admin panel and try to do something it crashes. Any solution? Is it because of the sub-categories or just categories?

Re: Opencart too slow - cache or another solution?

Posted: Fri Dec 16, 2011 9:41 am
by JAY6390
Get vQmod and install this
http://www.opencart.com/index.php?route ... on_id=3703
Free mod and will speed up your categories at the expense of losing your category counts showing up. That is what causes the category speed issue

Re: Opencart too slow - cache or another solution?

Posted: Fri Dec 16, 2011 11:39 am
by 3wcorner
JAY6390 wrote:Get vQmod and install this
http://www.opencart.com/index.php?route ... on_id=3703
Free mod and will speed up your categories at the expense of losing your category counts showing up. That is what causes the category speed issue
I agree with JAY6390, it is the category product count!
i have resolved this issue, and i will publish a fix for this in the mean time, you can just comment out the getProductsTotal function call in order to avoid this for now...

Re: Opencart too slow - cache or another solution?

Posted: Fri Dec 16, 2011 7:11 pm
by JAY6390
You can, but that would mean you would get
Category Name ()
In your category menu items, which is a little undesirable, along with errors in your error log

Re: Opencart too slow - cache or another solution?

Posted: Fri Dec 16, 2011 10:39 pm
by 3wcorner
Original code....

Code: Select all

$results = $this->model_catalog_category->getCategories($category_id);
			
			foreach ($results as $result) {
				$data = array(
					'filter_category_id'  => $result['category_id'],
					'filter_sub_category' => true	
				);
							
				$product_total = $this->model_catalog_product->getTotalProducts($data);
				
				$this->data['categories'][] = array(
					'name'  => $result['name'] . ' (' . $product_total . ')',
					'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url)
				);
			}
			
			$this->data['products'] = arr...
New code would look something like this.
$results = $this->model_catalog_category->getCategories($category_id);

foreach ($results as $result) {
$data = array(
'filter_category_id' => $result['category_id'],
'filter_sub_category' => true
);
// here we will comment out the following line.
//$product_total = $this->model_catalog_product->getTotalProducts($data);

$this->data['categories'][] = array(
//'name' => $result['name'] . ' (' . $product_total . ')', // here is where you prevent the () from showing.
'name' => $result['name'], // here is where you prevent the () from showing.
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url)
);
}

$this->data['products'] = arr...
i did not think i will need to explain such simple code it is obviously visible, and simple to understand.

Re: Opencart too slow - cache or another solution?

Posted: Wed Mar 07, 2012 6:18 am
by vildamatilda
benlhe wrote:Hi pro,
I am fresh & with very little knowledge on coding, I encounter the same problem, I contacted my hosting co. they said server is running fine, it probably due to my own internet connection. But I was able to browse other websites smoothly only my site was lag on loading..... any solution or catch / something I can do to speed it up ???

This is my site with about 350 products --> http://www.qqbox.my
Thanks
possible to get this to work on the version 1.4.9.3?? experience my page real slow and do not know why or what happened. Is there anyone who can look at my page and see if this module may be able to fix the problem.
www.webshop.barnbutikenvildamatilda.se
appreciate all the help I can get
Saw the change you did... the color of their various modules .... looks good, you would like to show me where to go in and change... needs to to get rid of the blue color??
also saw that you had a different category ... how did you get that idea from??

Re: Opencart too slow - cache or another solution?

Posted: Wed Mar 07, 2012 7:32 am
by 3wcorner
your issue is probably due to something else.
the count was added i think in the 1.5.x versions.
PM me, with your contact info, i'll be happy to go over it with you.

Manny E.
3w.