Post by zaidkhan » Wed Nov 24, 2010 3:29 pm

Hi Everyone,
I'm working on a website for my client which is almost complete.
currently I have around 300+ categories/subcategories and around 700 products
I have to add around 5000 more products in coming weeks.

I chose opencart because I found it very nice and user friendly, however the biggest issue I'm having is that the website is loading too slow.

I followed the instruction in this post and removed the categories drop down from the list.
http://forum.opencart.com/viewtopic.php ... 811#p61811

Before applying this method Website loading time was 27 seconds (http://www.webpagetest.org/result/101124_5YM/)
After Aplying the above method the time reduced to 19 seconds (http://www.webpagetest.org/result/101124_618/)
but this is still very slow.

Can any one tell me what is the actual issue which is causing the website to load slow.
here is the link of website
http://client.euwebdesignuk.co.uk/malo_products/final/

Newbie

Posts

Joined
Wed Nov 24, 2010 12:25 pm

Post by Xsecrets » Wed Nov 24, 2010 9:35 pm

you could follow the directions at this page to see if mysql is slowing things down and if so what queries are causing the problem.
http://forum.opencart.com/viewtopic.php?f=121&t=22048

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 » Thu Nov 25, 2010 9:22 am

The issue is likely the excessive amount of categories. Because of the recursive lookup that is done on the categories it takes a lot of time to build a tree of that many

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Xsecrets » Thu Nov 25, 2010 12:39 pm

I thought you cached the category lookup.

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 zaidkhan » Thu Nov 25, 2010 2:36 pm

Thanks for your replies,
Can you please suggest what do I have to do in order to resolve this issue.
Do I need to reduce the number of categories?
I used import/export module and created all the categories myself in the excel sheet. it was hard to manage so many categories and I had to give them long integer id's in order to make each id unique.

Newbie

Posts

Joined
Wed Nov 24, 2010 12:25 pm

Post by zaidkhan » Thu Nov 25, 2010 11:42 pm

Do you think web hosting could be one of the reasons?
My host is M6.net and it is on shared hosting.

Newbie

Posts

Joined
Wed Nov 24, 2010 12:25 pm

Post by cartpro » Fri Nov 26, 2010 3:03 am

First thing I would do is to disable the category module and comment out the following line in common/header.php (around line 118) to check if it is really category issue.

Code: Select all

$this->data['categories'] = $this->getCategories(0);
I have loaded my site with 200+ categories and 11,300+ product and it takes 10-15seconds. Check out at http://www.sansdirect.com and see if you see the same response.

Also, check your error log for any script errors and warnings. This will reduce the response time too.

Extensions: Multi-vendor extension
Shipping Modules: SuperShip Pro

Multi-Vendor Marketplace:Opencartmarketplace.com
IceCat to Opencart: Import millions of IceCat products to Opencart


New member

Posts

Joined
Fri Oct 29, 2010 1:50 am

Post by Qphoria » Fri Nov 26, 2010 4:48 am

Xsecrets wrote:I thought you cached the category lookup.
The search bar categories are cached, but not the side module

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Xsecrets » Fri Nov 26, 2010 8:02 am

ahh didn't realize that maybe we should cache that too.

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 zaidkhan » Fri Nov 26, 2010 3:10 pm

Thanks for your replies and help.
Would you please guide me how do I cache the sidebarmenu module.
It is quite similar to category module.

Newbie

Posts

Joined
Wed Nov 24, 2010 12:25 pm

Post by Qphoria » Fri Nov 26, 2010 3:56 pm

Actually I'm wrong. The caching IS on all categories. But I think there might be an issue with empty categories. Since the cache returns an empty array for categories with no subs, it requeries the database as it reads "empty array" and "false variable" the same.

So try this

1. EDIT: catalog/model/catalog/category.php

2. FIND:

Code: Select all

if (!$category_data) { 
3. REPLACE WITH:

Code: Select all

if (!$category_data && !is_array($category_data)) { 

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by zeroevil » Wed Dec 01, 2010 11:06 pm

Qphoria wrote:Actually I'm wrong. The caching IS on all categories. But I think there might be an issue with empty categories. Since the cache returns an empty array for categories with no subs, it requeries the database as it reads "empty array" and "false variable" the same.

So try this

1. EDIT: catalog/model/catalog/category.php

2. FIND:

Code: Select all

if (!$category_data) { 
3. REPLACE WITH:

Code: Select all

if (!$category_data && !is_array($category_data)) { 

I did it on my site Q and did the test below hope it helps out. but you may have something there I have a few empty categories as I am still stocking my store I'm keeping the inventory lite just to make sure.

now I am doing some testing right now as I am writing this
Test #
#1.) popup category mod disabled no side category option running.
Results : site running lighting fast

#2.) enabling popup category mod in cached mode
Results : large slow down 30sec page load times

#3.) enabling popup category mode non cached mode
Results : much faster 5sec page load times

seems if you disable the cache mode in the popup category mod it works much better. I'll do further testing on my half to make sure of the results. but right now the results look promising.

I recently moved to the island formally owned by Dr. Moreau and currently live there lost in a ocean of computer code with my cat Nigel... help us!!!


User avatar
New member

Posts

Joined
Thu Nov 25, 2010 2:05 am

Post by Qphoria » Wed Dec 01, 2010 11:15 pm

not sure what the popup category mod is but I assume they are using the same category lookup in the model. Did my change above improve anything?

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by zeroevil » Wed Dec 01, 2010 11:43 pm

Qphoria wrote:not sure what the popup category mod is but I assume they are using the same category lookup in the model. Did my change above improve anything?
popup category module is the mod I referred to, the author has a cache mode for it. But it seems the cache mode does more harm then good. http://www.opencart.com/index.php?route ... order=DESC


As of right now I think this is the solution Q. My site is running much faster and very efficient. So I'm gonna finishing loading my stock onto my site to make sure the slow down bug has been squashed.

I recently moved to the island formally owned by Dr. Moreau and currently live there lost in a ocean of computer code with my cat Nigel... help us!!!


User avatar
New member

Posts

Joined
Thu Nov 25, 2010 2:05 am

Post by zeroevil » Thu Dec 02, 2010 1:12 am

Well been running it for a couple of hours and its been running well. Thanks Q I think this is the solution!!

but I still haven't tested it on a standard site installation yet, since I have made some modifications to my base site installation. I have added a few modules, updated to 1.4.9.2 and added some code to my site from others in the forums that was trying to help on this issue. I know your fix had the greatest impact on resolving the issue but not sure if it was just part of the puzzle. So I guess the next step is to test this on a standard install of 1.4.9 with 300 categories and see what happens. Then move to add it to 1.5 and to a patch for 1.4.9 for others that are experiencing the same issue.

Again thanks Q !!!

I recently moved to the island formally owned by Dr. Moreau and currently live there lost in a ocean of computer code with my cat Nigel... help us!!!


User avatar
New member

Posts

Joined
Thu Nov 25, 2010 2:05 am

Post by Xsecrets » Thu Dec 02, 2010 5:00 am

just out of curiosity could someone who is having the slowness problems try adding an index on the parent_id field of the category table and see if that helps?

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 alex1 » Sat Dec 04, 2010 3:34 pm

cartpro wrote:First thing I would do is to disable the category module and comment out the following line in common/header.php (around line 118) to check if it is really category issue.

Code: Select all

$this->data['categories'] = $this->getCategories(0);
Wow! I tried this, and my site loaded almost instantly on every click. Incredible.

The site seems to work fine and nothing is broken that I can tell... what does this line actually do? Can I just leave it commented out?

Active Member

Posts

Joined
Sat Oct 16, 2010 9:49 am

Post by SapporoGuy » Sat Dec 04, 2010 7:11 pm

Q,
Nice fix!

930sc ... because it is fun!


User avatar
Active Member

Posts

Joined
Mon Nov 01, 2010 7:29 pm

Post by cartpro » Sat Dec 04, 2010 8:57 pm

Glad you found the issue.

What I would do is, cache the rendered category menu instead of caching individual category queries. That means, you will disaply all the categories in a multi-level menu. Check out menu on the header bar on my site http://www.sansdirect.com

Extensions: Multi-vendor extension
Shipping Modules: SuperShip Pro

Multi-Vendor Marketplace:Opencartmarketplace.com
IceCat to Opencart: Import millions of IceCat products to Opencart


New member

Posts

Joined
Fri Oct 29, 2010 1:50 am

Post by alex1 » Mon Dec 06, 2010 2:21 am

cartpro wrote:Check out menu on the header bar on my site http://www.sansdirect.com
Your site is painfully slow.

Why don't you use the removal of:

Code: Select all

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


yourself?

Active Member

Posts

Joined
Sat Oct 16, 2010 9:49 am
Who is online

Users browsing this forum: No registered users and 102 guests