Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-06-15 01:22:18

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

A word to the wise...

There’s something afoot over at Textdrive relating to Textpattern & hogging of mysql resources. Could be a plugin bug, could be poor template management, or could be something else. So far, the consensus has been too many nested plugin template tags, but I disagree. Perhaps someone might care to take a closer look?

Offline

#2 2005-06-15 02:26:12

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

Re: A word to the wise...

That is strange. I havn’t had any problems. I am wondering if there wasn’t something else going on. I looked at the template and it did not seem extraordinary. I have run rss_superarchive on many machine and locally as well and never saw that kind of sql hogging.

Offline

#3 2005-06-15 03:45:09

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: A word to the wise...

I’m not familiar with the rss_superarchive, but I just had a quick glance at the code. My impression is that it wasn’t written with efficiency in mind. I wouldn’t be surprised to see it exhaust the available memory if used to display a large archive.

That doesn’t explain the insane number of queries being executed though.

BTW, for those concerned about performance: you can probably achieve some of the functionality of rss_superarchive much more efficiently using <txp:article_custom />.


Alex

Offline

#4 2005-06-15 05:31:14

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: A word to the wise...

anyone know of any examples lying around here for those in need of an article_custom demo?

Offline

#5 2005-06-15 10:31:45

sekhu
Member
Registered: 2005-05-12
Posts: 428
Website

Re: A word to the wise...

interesting article, i use the plugin and am hoping it will have a pagination feature – would this alleviate any of the problems that are being cuased by large archives (I only have 190-210 at the moment)?

Offline

#6 2005-06-15 11:51:23

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: A word to the wise...

> Perhaps someone might care to take a closer look?

I wrote this in the other thread, but given that it seems to fit better here:

The reason why many people don’t have problems while steve did, is likely the number of entries he had (it’s not the cause, but the reason why it beame noticable). Google shows that (according to the urls in his permalinks) he has more than 4500 entries.

The code for txp’s own article_custom as well rss_superarchive makes additional queries for each article in a list (one for comment count, one for the author name, (roughly) one for prev/next links, sometimes one for the article-form). So for a 2000 articles instead of a handful of queries, you have 3-4000 queries. This is fixable, but I guess it is not a high priority for txps own tags, because they were not really made for such huge lists.

For a plugin that wants to make a list of every article for an archive, this is more of a problem. Ways around it:

  • - Short term: Wrap zem_cache around the list of articles.
  • - Long term (for long lists of articles): Drop the query for next/prev links, don’t get the article-form (it’s not really needed for an archive list IMO), either join the usertable to get the author names or do one query to fetch all authors and use an array to access it from the article-loop.
    That would still leave the comment-count as a query: Either leave it out, or only make it when the user actually uses the tag, or better yet, keep a count of comments in the article-table that is only updated when a comment is posted/deleted/moderated. THe last one would be the best option. Either way, this is something that’s a feature request for txp as it’s not really a task that a plugin can do lightly (except for leaving out the query and thus the information totally).

Last edited by Sencer (2005-06-15 11:53:15)

Offline

#7 2005-06-15 13:14:14

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: A word to the wise...

There’s also the memory usage issue – the plugin appears to do a safe_rows(‘*’, ..), essentially loading all articles into memory at once.

Drop the query for next/prev links

This should be sorted in rev 411/412, though I’m not sure it’ll help with the plugin.

The other suggestions are all good. Like everything, a matter of time.


Alex

Offline

#8 2005-06-15 13:21:03

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: A word to the wise...

Ah, thanks zem. I was on 405, didn’t check for newer commits. And you’re right about memory, too.

wilshire uses populateArticleData() so updating to a new txp-rev. should still help reduce queries.

I also agree about “matter of time”. There are more important issues, and long list with several hundreds of articles aren’t really a key/must-have feature (I don’t have such a thing anywhere on any of my sites). I’d much rather see a 1.0 release and have those things dealt with in future releases. :)

Offline

Board footer

Powered by FluxBB