Page 1 of 2

OpenCart 3 website running very very slow...

Posted: Wed Dec 13, 2017 6:04 pm
by LoveMortuus
Hello,
We've been setting up an Opencart 3 store for almost a month now, an the more we've been setting it up the slower the store has been running, now that we're closing to the end of the setup the site is SUPER slow, Google Chrome requires up to 20 seconds to load the site, and this really shouldn't be happening...

If anyone has any info please do tell,
you can access our store at this link.

Re: OpenCart 3 website running very very slow...

Posted: Wed Dec 13, 2017 10:25 pm
by straightlight
No OC version provided. However, ensure to disable the categories count from your admin - > systems - > settings - > edit settings page.

Re: OpenCart 3 website running very very slow...

Posted: Thu Dec 14, 2017 3:30 am
by IP_CAM
Well, just have a look at a Browser Source View Page like:

https://8000plus.si/RAZVOJ/kcgsi/openca ... 2_143_144

to then be confronted with a left side Category design, using just a little below 3'000 Code Lines,
and also with wide open spaces of NOTHING in between. You attempt to display each and every
Category, and this has a dramatic effect on Page Load, whereever the Category Section is displayed.
There are 2953 DOM elements on that more or less empty page !
---
Otherways, check this Link, to easy find out, what else could be done, to further improve Performance:
https://gtmetrix.com/reports/8000plus.si/OEfuz1hB
Good Luck! ;)
Ernie

Re: OpenCart 3 website running very very slow...

Posted: Thu Dec 14, 2017 4:01 pm
by LoveMortuus
IP_CAM wrote:
Thu Dec 14, 2017 3:30 am
Well, just have a look at a Browser Source View Page like:

https://8000plus.si/RAZVOJ/kcgsi/openca ... 2_143_144

to then be confronted with a left side Category design, using just a little below 3'000 Code Lines,
and also with wide open spaces of NOTHING in between. You attempt to display each and every
Category, and this has a dramatic effect on Page Load, whereever the Category Section is displayed.
There are 2953 DOM elements on that more or less empty page !
---
Otherways, check this Link, to easy find out, what else could be done, to further improve Performance:
https://gtmetrix.com/reports/8000plus.si/OEfuz1hB
Good Luck! ;)
Ernie
Thanks for the help,
Do you know how else could I do the category section, we choose this one because it was the one that we found in the extension market and was the closest to what we wanted, even though it wasn't fully what we wanted, sadly the extension support for OC 3 isn't that good for now, so we don't really know what to do...

And because the design is done in Twig we have even less of an idea as to what to do...
I do think that it should be done recursively, but I don't know how to do that, because we mostly use other languages. If you have any ideas or advices please do share them!

Re: OpenCart 3 website running very very slow...

Posted: Thu Dec 14, 2017 4:27 pm
by Pallavi_G
Below three are the main reasons for your Opencart website being slow -
  • Your hosting service isn't good enough.
    If your module installed is buggy it is making a lot of wrong queries.
    There are several high-quality images.
Check for good hosting -
You can check the reviews for different hosting companies or ask a query to the hosting company's support team and check if they solve it correctly. This can help you to choose a good hosting.

To Prevent Buggy Module :
Check the ratings and comments prior to purchasing an extension.
You can also ask a doubt to developer and check if you get a response or not. If you don’t get the response for a long time, then response shall be mostly slow. So, think before purchase.

Avoid High Quality Image :
On home page avoid using a high quality image in banners or slide shows. Have an equal portion of text and images. So home page loads quickly.

Besides above, you can also test your site at Website Speed and Performance Optimization.
They give you error report which you should try to fix it. Its free.

Re: OpenCart 3 website running very very slow...

Posted: Mon Dec 18, 2017 4:14 pm
by LoveMortuus
There are so many DOM elements because this store has around 1200 categories.
Is there a way to tell twig to only load those categories that are currently visible?
Because I do believe that doing so could solve the slow loading problem.

Re: OpenCart 3 website running very very slow...

Posted: Tue Dec 19, 2017 3:27 am
by IP_CAM
Well, after looking into the OC v.3.0.2.x Code, I found very similar Lines in my OC v.1.5.6.5,
when it comes to the Routine, as shown below, used to speed up this Task and so OC !

So, one could try, if this Budgetneon.com designed Category CACHE System still works,
by adapting this OC v.1.5.6.x Line:
$cacheid='product.gettotalproducts.'.md5($sql).(int)$customer_group_id;
to make the DB Access work with OC v.3.x, then, the Categories Numbers would
be called from the Cache Section, and no longer counted from/in the DB, and this usually
improves Category Counting Performance very very mucho. :D
---
It's the catalog/model/category/product.php File, wich has to be modified:
DEFAULT OC Code OC v.1.5.x - 3.x:

Code: Select all

	if (!empty($data['filter_manufacturer_id'])) {
		$sql .= " AND p.manufacturer_id = '" . (int)$data['filter_manufacturer_id'] . "'";
	}
	
		$query = $this->db->query($sql);

	return $query->row['total'];
}
to be replaced with THIS:

Code: Select all

	if (!empty($data['filter_manufacturer_id'])) {
		$sql .= " AND p.manufacturer_id = '" . (int)$data['filter_manufacturer_id'] . "'";
	}

//JTI MOD  v.1.5.6.x, WILL NOT work in OC v.2.1.+ this way !!
//  $query = $this->db->query($sql); // default OC Line
//  return $query->row['total']; // default OC Line
$cacheid='product.gettotalproducts.'.md5($sql).(int)$customer_group_id;
$total=$this->cache->get($cacheid);
if ($total === null ) {
$query = $this->db->query($sql);
	$total = $query->row['total'];
	$this->cache->set($cacheid,$total);
  }
return $total;
// END JTI MOD
}
Hopefully, someone of the v.3 Insiders will be willing to change and test it.
Good Luck! ;)
Ernie
---
PS: A different nice Version, by WeismannWeb.com, adding all those Numbers into one single file,
separated into Header- and Category Files, containing other cached Data too, can be found here,
it's much more compehensivly coded, and would require a total rewrite, to make it work
in V.2 + Versions, just to mention this. I use 'em both, in my 1.5.6.5 Version Sites, depending on Mood :laugh:
http://www.codegist.net/snippet/xml/cac ... annweb_xml
and it's cache files look like this. Performance-wise, it's about the same, by use of a few Cat's only... ::)
Image
---
Budgetneon.com Category Cache Solution:
Image

Re: OpenCart 3 website running very very slow...

Posted: Tue Dec 19, 2017 11:35 pm
by LoveMortuus
There are only about 6 products in the store at the moment, so that's not slowing it down right now.
What is slowing it down is website loading all categories even though we can only see 1% of them at any given time...

We need to somehow tell twig or the site to only load the visible categories, and not all of them.
Because what it does now is it loads all of them and it then folds them...

Side question: Is OpenCart using pthread?

Re: OpenCart 3 website running very very slow...

Posted: Tue Dec 19, 2017 11:41 pm
by straightlight
What is slowing it down is website loading all categories even though we can only see 1% of them at any given time...
If you are referring to the categories module, you could disable the category count from the admin - > system - > settings - > edit settings page and the same could be adjusted with your product counts per page on the edit settings page in order to reduce the query results for your products.

Re: OpenCart 3 website running very very slow...

Posted: Wed Dec 20, 2017 11:27 am
by IP_CAM
Well, just turning of the Category count is similar to turning off the Lights,
if one plans to save energy, but Visitors don't like to click around in categories,
to eventually then be confronted with empty Pages only. ::)

One reason, why I never use latest OC - Versions, when it comes to solve minor
Problems like this, it's the lack of expertise, preventing one, from making something
work, as it actually should, by default. :'(
Good Luck! ;)
Ernie

Re: OpenCart 3 website running very very slow...

Posted: Wed Dec 20, 2017 3:51 pm
by LoveMortuus
straightlight wrote:
Tue Dec 19, 2017 11:41 pm
What is slowing it down is website loading all categories even though we can only see 1% of them at any given time...
If you are referring to the categories module, you could disable the category count from the admin - > system - > settings - > edit settings page and the same could be adjusted with your product counts per page on the edit settings page in order to reduce the query results for your products.
We're already tried disabling this, but it didn't change anything...

Ugh! This is so annoying!

But if we set up OC2 then we need to create all the 1200+ categories again!

Re: OpenCart 3 website running very very slow...

Posted: Wed Dec 20, 2017 8:57 pm
by straightlight
LoveMortuus wrote:
Wed Dec 20, 2017 3:51 pm
straightlight wrote:
Tue Dec 19, 2017 11:41 pm
What is slowing it down is website loading all categories even though we can only see 1% of them at any given time...
If you are referring to the categories module, you could disable the category count from the admin - > system - > settings - > edit settings page and the same could be adjusted with your product counts per page on the edit settings page in order to reduce the query results for your products.
We're already tried disabling this, but it didn't change anything...

Ugh! This is so annoying!

But if we set up OC2 then we need to create all the 1200+ categories again!
If the results are the same after disabling / reducing the counts, it may be caused by multiple factors due to the extensions installed that one or many may affect performance or the server packages level you have purchased with your host or also the limited hardware capacity that your host may offer overall since it is pretty rare, otherwise, that we see these kinds of posts on the forum related to the core level when either the category count is disabled and / or the page result limit has been reduced.

One thing is for sure, despite what the pessimist might post above your post, it is not related to an OC version issue in this case that is beyond v1.5x releases.

Re: OpenCart 3 website running very very slow...

Posted: Wed Dec 20, 2017 9:54 pm
by LoveMortuus
If we decrease the number of categories the website runs faster, but our customer wants to have this many categories.
The website is not limited by the host or the hardware, we host our own sites and we have brand new servers, so I don't think that's the problem.

Re: OpenCart 3 website running very very slow...

Posted: Wed Dec 20, 2017 10:05 pm
by straightlight
LoveMortuus wrote:
Wed Dec 20, 2017 9:54 pm
If we decrease the number of categories the website runs faster, but our customer wants to have this many categories.
The website is not limited by the host or the hardware, we host our own sites and we have brand new servers, so I don't think that's the problem.
On your host console, click on your latest visitors stats. Then, click the view icon. What are your stats level?

Re: OpenCart 3 website running very very slow...

Posted: Wed Dec 20, 2017 10:49 pm
by straightlight
A relative subject seem to be continuing on this topic: viewtopic.php?f=190&t=200595

Re: OpenCart 3 website running very very slow...

Posted: Thu Dec 21, 2017 12:31 am
by IP_CAM
One thing is for sure, despite what the pessimist might post above your post, it is not related to an OC version issue

Well, many categories have always been an OC performance issue, regardless of the Version,
and most OC Users, around OC for some time, are well aware of this fact. But instead of trying
to get personal, one could better assist others, to eventually find easy Solutions, possibly even
by use of already existing old Code. It would sure be much more helpful, and less ideologistic,
compared with, what Posters lately find on ever the same two liner replies. And if, then such
should be a matter for those, in charge of this place, I assume...

But I am not pessimistic, and sure not an Ideologist either, I just count on facts and experience,
gattered by also creating a well-done 3-digit amount of different OC Versions Testshops, in
about 15k hours. This, to find out, what is required to know, have, and use, to eventually end up
with a 100% Performance result. That's all, I was looking for, but sure not for arguments, those,
I can have at home with my Wife, and in my own language too ...

Ernie
----
I am glad, I have it made, it's time, to take a rest. ::)
---
Image

Re: OpenCart 3 website running very very slow...

Posted: Thu May 03, 2018 11:14 pm
by alexmorco
Sometimes it happens due to sever issue or slow hosting, Try Cloudways opencart hosting, hope their support team will fix your issue.

Re: OpenCart 3 website running very very slow...

Posted: Fri May 04, 2018 1:53 am
by sw!tch
alexmorco wrote:
Thu May 03, 2018 11:14 pm
Sometimes it happens due to sever issue or slow hosting, Try Cloudways opencart hosting, hope their support team will fix your issue.
^ What he said. This almost certainly a hosting issue, but really depends on your current server specs. I would contact your hosting provider and ask them why your website is slow, chances are they are limiting resources, especially if this is cheap shared hosting. You can log slow queries in mySQL to give you an idea on where it's coming from.

If you are pulling 1200 categories at once and the server doesn't have enough resources then thats most likely the problem, you need to implement cacheing and or upgrade your hosting specs.

If you have SSH access you can easily see the load by running "top" and refreshing the page. It will give you an idea on the resource and CPU usage.

Re: OpenCart 3 website running very very slow...

Posted: Thu Mar 28, 2019 7:20 pm
by cemfirat
I have the same Problem… i think the server reaction … ho can i test it?

Re: OpenCart 3 website running very very slow...

Posted: Fri Apr 17, 2020 12:41 am
by hyeclass
even though i index the category db the category is running so slow, i mean it takes 6 seconds to open a category, any solution to this issue