Articles with EKS very slow to load

3 years 2 weeks ago #9891 by tsbvi771
Articles with EKS very slow to load was created by tsbvi771
Good afternoon from Austin, TX!

I am using Joomla 3.4.3 and have successfully (I think!) installed EKS. The results DO load, but after up to 15 seconds! During this time, my server (apache2) CPU used jumps to 80-90%.

EXAMPLE: Visit http://www.tsbvi.edu/tagged-resources and click on any of the links with (CONTINUE READING).

This plugin perfectly meets the needs of our pages, but the load times are not acceptable.

Can you please tell me what can be done to speed up the load time and reduce the load on the CPU? Thank you in advance for your help!

3 years 2 weeks ago - 3 years 2 weeks ago #9892 by Vitja
Replied by Vitja on topic Articles with EKS very slow to load
Hello from Germany, tsbvi771,

thank you for activating a support subscription!

Hmm, this is strange. How many articles do you have? I use the core functionality from the model of the content component to load the correct articles... This sounds like a major problem, but then it should also affect the core of Joomla!...

Can you provide me a dev copy of the website so that I could do some debugging tests? I will need the credentials to Joomla! and to the server (FTP or SSH) to do it. Please send credentials only via email (if possible then use PGP to encrypt the content). A backup archive (e.g. from Akeeba Backup) would even be better, because I could then debug it on my local development environment. Please remove all sensitive data before you send it to me.

Thank you!

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997
3 years 2 weeks ago #9893 by tsbvi771
Replied by tsbvi771 on topic Articles with EKS very slow to load
Unfortunately, it is not possible for me to send you a demo copy of the site. We have over 7,000 articles and about 724 tags. Our site is quite massive as it is a global resource for persons with visual impairments and the teachers, administrators and families of those folks.

Is the plugin not at its best with so large a site?

If the script is iterating through every article and then matching to every instance of the selected tag word, that would explain the delay. Is it not possible to query first the tag name, associate it with the tag ID and then pull the relevant articles with that tag id? It may be faster than approaching from the article IDs first, if that is the case.

I will do some testing here and request permission to provide you with an administrative login to take a look.
Thank you for the quick response!
3 years 2 weeks ago #9894 by Vitja
Replied by Vitja on topic Articles with EKS very slow to load
I understand you! 7.000 articles and 724 tags? Wow, that's a lot!

A fast solution would be to limit the requests to specific article categories. If you use specific categories for the articles, then you could easily increase the performance by pre-selecting the correct IDs (add e.g. catid=1,4,8 in the syntax call). Or you could use the core cache functionality to cache the output of the plugin.

I will look whether I can improve the SQL query to get only matching items directly from the database.

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997
3 years 2 weeks ago #9895 by tsbvi771
Replied by tsbvi771 on topic Articles with EKS very slow to load
I will try that!

Yes, this site is a behemoth and trying to constantly improve accessibility for every component, module, plugin and content item is a challenge.

Thank you for the excellent response and willingness to look into ways to improve your plugin. I appreciate it greatly!
3 years 2 weeks ago - 3 years 2 weeks ago #9896 by Vitja
Replied by Vitja on topic Articles with EKS very slow to load
Okay, I've improved the SQL requests.

The bad news is that you have to add my improvement manually to the model of the content component. The "tags" parameter has to be used for this modified version -> e.g. {eks}keyword=tree,house,car|tags{/eks}

What to do?

1. Install the attached file as usual (see below, you have to be logged in to see it)
2. Add the tags filter to the model (modify the mentioned file, don't forget a backup)
3. Test the performance improvement in the frontend

Open: components/com_content/models/articles.php

Search for (at the end of the function getListQuery):
// Add the list ordering clause.
$query->order($this->getState('list.ordering', 'a.ordering') . ' ' . $this->getState('list.direction', 'ASC'));

Add before:
// Kubik-Rubik Solution - Add tags filter
if ($this->getState('filter.tags'))
{
	// Join over the tags.
	$query->select('t.tag_id AS tag_id')
		->join('LEFT', '#__contentitem_tag_map AS t ON t.content_item_id = a.id AND t.type_alias = \'com_content.article\'');

	$query->where('tag_id IN (' . implode(',', $this->getState('filter.tags')) . ')');

	$query->group('a.id');
}
// Kubik-Rubik Solution - Add tags filter

Remember: This is a core hack! Your change can be overwritten if you update the core to a newer release.

File to install:
Part of the message is hidden for the guests. Please log in or register to see it.


Please follow the instructions and give me some feedback. If it works, we could get the filter into the core!

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997

This message has an attachment file.
Please log in or register to see it.

3 years 2 weeks ago #9897 by Vitja
Replied by Vitja on topic Articles with EKS very slow to load
Just updated the modified version because it threw an error if only one keyword was used. Please re-download the package if you did download it already!

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997
3 years 2 weeks ago - 3 years 2 weeks ago #9898 by tsbvi771
Replied by tsbvi771 on topic Articles with EKS very slow to load
Good morning!
There is no download attached to this message. Did you update the original package by the same name as the first? Never mind! I see the updated date on the php file. Thanks and sorry for the oops!

I downloaded it and installed it last night. It had some unexpected results, so I look forward to trying this version. I'll let you know as soon as it's in place. Thank you!
3 years 2 weeks ago #9899 by tsbvi771
Replied by tsbvi771 on topic Articles with EKS very slow to load
Unfortunately, now there are no results rendered.
3 years 2 weeks ago #9900 by Vitja
Replied by Vitja on topic Articles with EKS very slow to load
I've tested it with over 1500 articles on a test site today and the process was more than 5 times faster with the modification.

1. Do you use the parameter "tags" in the syntax?
2. It only works if you change the "articles.php" properly. Can you upload the version that you've edited? (Upload it as a zip archive here.)

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997
Time to create page: 0.208 seconds