News:

Support the VirtueMart project and become a member

Main Menu

SEF Url's increasing load time by ~1 second?

Started by Otto0815, December 07, 2015, 16:58:31 PM

Previous topic - Next topic

Otto0815

Hi,

i'm just optimizing my site for more speed, since the "Time to first byte" ist about 1.6 seconds.
Now i found out that the Joomla SEF section is causing this problem.
If i turn off every setting for SEO in the Joomla configuration the "TTFB" is going down to 0.6 seconds (wich is still long since my dbqueries are only taking 39.2ms)...

Has anyone else this problem and maybe an solution for it?

   

Studio 42

Are you on a dedicated server ?
Are the slow speed with SEF in all components or only VM ?
What is your Joomla+VM release?

Otto0815

1)I'm at an server hoster with 30 other clients on the machine
2)the slow speed ist also on the start page of my shop, there is only vm installed
3)joomla 3.5.4 & VM 3.0.12

GJC Web Design

I know Max found a fix for the vm router that reduced the duplicate queries a lot.. 

I don't think this has been released yet.

if you test with Joomla debug on and SEF are there a lot of duplicate queries?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Otto0815

Quote from: GJC Web Design on December 08, 2015, 00:53:53 AM
I know Max found a fix for the vm router that reduced the duplicate queries a lot.. 

I don't think this has been released yet.

if you test with Joomla debug on and SEF are there a lot of duplicate queries?

With Joomla SEO on (the first 3 options) and VM SEO i always get a blank page when i try the debug option.
If i turn the first 3 joomla SEO options to "off" i got 227 queires and 86 duplicate queries in 60.9 ms;  46.58mb memory usage.

GJC Web Design

yes -- debug does take a huge amount of memory

try the attached router.php .. on my installs it reduced the dups massively especially when using the category module

on multi-lingual sites there is also a huge number of dups with the lang switcher module and lang plugin

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Otto0815

#6
I just tried it (in components/com_virtuemart) and it changes nothing regarding the duplicate queries.
But now the time to first byte is at 837-1.02ms (from 1.60ms+) and the queries are down to 221.

And yes, it seems like the most duplicates are from the categories (i'm using MaximenuCK)

Sometimes when i reload my page i got this error:

JForm::getInstance could not load file

But i dont think it has anything to do with it?Google couldn't get me some answer for this & virtuemart

Edit:

And i've got 2 duplicate scrips loaded:

media/jui/js/jquery-noconflict.js
com_virtuemart/assets/js/jquery.noconflict.js?vmver=9058

com_virtuemart/assets/js/jquery-ui.min.js?vmver=9058
media/jui/js/jquery.min.js

Are they all needed?If not, how to get rid of it...?

GJC Web Design

the js aren't dups!

ones no conflict and the other is ui

i'm using MaximenuCK

then not a VM problem

router - I explained when this could make a difference
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Otto0815

#8
Thx for directing me in the right direction....

As i've said, with your router.php the things are running better.
I've just tried with the original virtuemart category module (i'm not using any language plugin) and the duplicates are down to 20.
Most duplicate queries are now coming from "_content", "_content_item_tag_map", "virtuemart_userfield_values" & "virtuemart_userfield_countries"

Regarding the JS:
they are all 4 executed on my page, also 2x noconflict & jquery-ui-min + jquiry-ui




GJC Web Design

in an ideal world there would be no dups.. but you have to weigh the effort required of caching functions against what you have now

I doubt 20 dups adds more than a few mSec to the page get

otherwise its dig deeper  .. trace them, cache them or find another solution

e.g. the lang stuff is horrendous as soon as you get more than a couple of langs.. it was of the order of 100's of dups

They were all stock queries to get the published frontend languages over and over again

I solved by making a config in the lang module and plugin where u simply set the published langs and it is then a parameter

Ok . its not automatic , if u add a lang them you need to add it to the mod and plug .. but who is pub/unpub langs daily?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Studio 42

#10
Quote from: GJC Web Design on December 08, 2015, 11:21:34 AM
in an ideal world there would be no dups.. but you have to weigh the effort required of caching functions against what you have now

I doubt 20 dups adds more than a few mSec to the page get

otherwise its dig deeper  .. trace them, cache them or find another solution

e.g. the lang stuff is horrendous as soon as you get more than a couple of langs.. it was of the order of 100's of dups

They were all stock queries to get the published frontend languages over and over again

I solved by making a config in the lang module and plugin where u simply set the published langs and it is then a parameter

Ok . its not automatic , if u add a lang them you need to add it to the mod and plug .. but who is pub/unpub langs daily?

I don't understand, why you think that lang module do more queries?
My language switcher do only 1 query per lang and per parent category(if this have no menu) and Joomla language no more as a standard links.
This is negligible compared to Virtuemart number of queries if you display 20 products in a page, having prices and images... you have perhaps 200 queries.

In my test(i use a cache, so i know the queries in VM)
52 exclude component
624 QUERIES include component for 30 products!

i'm currently on hacking this for a customer because for this website, i only need 1 or 2 queries per product in category, because i need 1 image+name. No customfieilds, No Price, No extra Vendor and i think at end i win many memory and time loads.
I Hate hacks, but i think at end the time needed to load all the page is only 200 to 300 ms and current i need 2 to 3 secondes for 30 products.
PS: 60 queries are for com_wishlist

GJC Web Design

I meant duplicate queries for the Joomla lang mod and plugin

I have done the tests on a site with 22 configured languages

I have attached some of the screens I did at the time and my notes

Core language filter system plugin
it calls the same function three times for each language to find the enabled FE languages. In our case 60 + duplicates.
These eliminated by manually setting the configured langs as a parameter

the biggest saving of dups Max fixed in the lasted router.. was when the category module was used

see the screens before and after



GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Milbo

Quote from: GJC Web Design on December 09, 2015, 00:41:24 AM
Core language filter system plugin
it calls the same function three times for each language to find the enabled FE languages. In our case 60 + duplicates.
These eliminated by manually setting the configured langs as a parameter

Please explain closer. You know we may replace it by our own module/plugin.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

GJC Web Design

for each language the lang changer and the lang filter plugin call 4 or 6 (I forget) times the function:

$this->sitelangs = MultilangstatusHelper::getSitelangs();

if you have many langs configured this soon adds up

I just replaced this with a config in the xml and form an array in the plug

$string = $this->params->get('langstring', '');
   $langarray = explode(',',$string);
   $langarray2 = array_flip($langarray);

// we also check if frontend language exists and is enabled
            /*if (($language->access && !in_array($language->access, $levels))
               || (!array_key_exists($language->lang_code, MultilangstatusHelper::getSitelangs())))
            {*/
            if (($language->access && !in_array($language->access, $levels))
               || (!array_key_exists($language->lang_code, $langarray2)))

a better way of course would be to cache the MultilangstatusHelper::getSitelangs()
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Studio 42

Quote from: GJC Web Design on December 17, 2015, 13:46:13 PM

$this->sitelangs = MultilangstatusHelper::getSitelangs();
Sould use a static in the helper of course, Perhaps reporting it on Joomla Github, that someone change the code ?
But what i don't understand, is why this get called su many time in 1 module ?