We make tools that make websites.

Forums (Archived)

The Solspace Support Forums are now CLOSED (read-only)

Check out our new support options here. Please refer to this blog post for more information.

   

Intermittent Date and Limit issue with Dynamic Template Morsels

Rank

Total Posts: 24

Joined: May 6, 2005

PM

Ignore

 

We have an intermittent issue with dynamic template morsels.  It occurs maybe 3 times a month or so (at least that’s how often we catch it. 

And then it just goes away on it’s own.  But it’s a fairly big issue.

Basically on occasion the weblog:entries tag will grab a single article (instead of 10 as instructed) and instead of grabbing them properly by date it will grab a MUCH older article.  This results in our page suddenly having almost no content and what content it does have is incredibly old.  It’s a frustrating issue and I’ve been unable to find any pattern.

Has anyone else seen this?

Jamie

Avatar
RankRankRankRankRank

Total Posts: 9901

Joined: Jan 8, 2009

PM

Ignore

 

Hi Jamie,

What version of EE are you using (I’m assuming you’re on 1.x?)
What version of Template Morsels are you using?
There was a new version released recently (well, last month), so if you haven’t updated yet I would recommend it smile

Signature

Rank

Total Posts: 24

Joined: May 6, 2005

PM

Ignore

 

Using EE 1.7.1 and Template Morsels is older actually.  I’d not noticed a new release.  I’ll try that first.  But this has been a problem for some time.  I just didn’t notice it much at first but one of our author’s has run into it now quite regularly.

If I still have problems I’ll be back.  smile

Rank

Total Posts: 24

Joined: May 6, 2005

PM

Ignore

 

OK, so I’m now coming back to this. 

First just to make sure we are on the same page:

1. EE is at 1.7.1
2. Template Morsels is at 1.5.4

I updated from Template Morsels 1.1.1 (I think it was) to 1.5.4 last Friday and while I noticed some increased server load I assumed it was mostly just the morsel database regenerating after an update.

The good news is that at least so far I’ve not seen a recurrence of the previous issue with a morsel pulling entries from the past instead of the present.

However, once Monday rolled around and traffic ticked up I’m now seeing even more increased server load.  Enough that pages (including our index page) were sometimes timing out.  At first I assumed I must have made a template change that increased overall queries to the pages.  But I’ve now spent a full day running through everything and not only have I not made any changes that would cause that the query counts are basically unchanged.  So I’m left with an update to the latest Template Morsels that seems to perform MUCH worse than the old version.  Is this a known issue?  I’m not finding any mentions of it anywhere.  I’d really appreciate someone taking a look as this is making my life miserable at an already stressful time.

Avatar
RankRankRankRankRank

Total Posts: 9901

Joined: Jan 8, 2009

PM

Ignore

 

Hi methnen,

That isn’t a known issue to us at this time. Are you getting above-average and above-normal traffic?

Is the page loading slow for all pages on the site, or are there particular templates that are especially slow? Do these templates contain template morsels?

What is your morsel Refresh setting? If set too low, refresh will be very frequent.
Are your templates/categories/entries being edited or published often? Depending on your morsel settings, this might trigger a frequent refresh as well. smile

Signature

Rank

Total Posts: 24

Joined: May 6, 2005

PM

Ignore

 

Nicolas,

Sorry for the delay in responding.  I’m having the day from hell.

Anyway, I’m pretty sure it’s the update to the latest version that has caused this. 

There’s no specific template that slow.  It’s hitting the server hard enough that simply every page (and the CP) is just slower than normal.  By a lot.  The index page which used to render in about .3 second is now rendering in .8 to a full 7 seconds depending on the page load.

I don’t actually do ANY refreshing via category/template/entry publishing.  So there’s no chance of that causing inappropriate refreshes that I know of.  After the update our Apache servers are simply working MUCH harder than they ever have before.  I do use Template Morsels pretty extensively in our site, but it’s never caused anything like this before.

I’m at the point where I’m completely at a loss as to what to do.  We need the caching to handle our traffic, but at the same time I can’t keep running Template Morsels like this or it’ll bring down the Apache servers every time our traffic picks up at all.

Are there any changes to how Template Morsel tags work that might have caused something unusual in certain cases?  The SQL server isn’t being overworked, this is just on our two Apache servers that the server load is spiking.

You know, strangely enough when running template debugging the actual template parsing is finishing about .2+ seconds before the page is finished being built.  Which is weird.  Something after the template is done being parsed is causing some additional processing churn.  I’ve never seen that much of a discrepancy before. 

So you’ve never seen anything like this happen?

Jamie

Rank

Total Posts: 24

Joined: May 6, 2005

PM

Ignore

 

Wanted to follow up to mention that I’ve asked EllisLab for a possible pointer as well and would be happy to provide your staff with a login/pass if that might help investigate this issue.  I’d be eternally grateful for any help at all.  Having our sites slow to crawl is obviously making my life interesting this week.  The EllisLab thread is here:

http://expressionengine.com/forums/viewthread/205162/

Jamie

Avatar
RankRankRankRankRank

Total Posts: 9901

Joined: Jan 8, 2009

PM

Ignore

 

Hi Jamie,

Unfortunately, we haven’t received any other reports of slowness because of Template Morsels.

Template Morsels, once parsed and cached, are stored in the database, skipping EE processes. Since the value is taken from the database only, your observation that your SQL server isn’t being overworked is a good sign that TM isn’t taking the SQL server. smile

This is important to ask, though: Are you getting above-average and above-normal traffic?
How are your access/error logs on your server? Are there more items logged than usual?
How about site monitoring software, such as Google Analytics? Are there more visitors to your site?

How about template debugging and output profiler? Are there any high numbers there, and if so, where?
Have you increased the “Refresh” value in Template Morsels to a high number so that refreshing of morsels doesn’t happen often?

Signature

Rank

Total Posts: 24

Joined: May 6, 2005

PM

Ignore

 

Quick answers:

Traffic is not abnormal.  If anything it’s a little lower than normal today and we are still having the above normal server load.

GA and Mint both reflect normal traffic levels.

In template debugging there’s no obvious items sticking out (except that everything is just a bit slower the normal).  Nothing at all seems abnormal.  I can send a log to you via email if you’d like to look and see if you can find anything I’m missing.

I’ve asked EngineHosting about the access/error logs as I don’t have access to those.

Jamie

Rank

Total Posts: 24

Joined: May 6, 2005

PM

Ignore

 

EngineHosting tells me there’s nothing out of the ordinary in the actual server logs.

Jamie

Avatar
RankRankRankRankRank

Total Posts: 9901

Joined: Jan 8, 2009

PM

Ignore

 

Hm, I really wonder what could be going on. Would downgrading temporarily remove the issue for now? Alternately, can you do an uninstall/reinstall of Template Morsels? Remember that module data is lost when it’s uninstalled, so this would be best to do this if you only have a few morsels and can easily rebuild your morsels after reinstallation smile Make sure you have backups ready before going down that road in case you need to go back to a working state!
Let me know what you think and if this is possible.

In the meantime, could you send me a PM with a login account so I can have a closer look? I’ll have a look tomorrow morning. An FTP account would also be nice, just in case I need to look at the filesystem. smile

Anyone else is free to pitch in to discuss this issue, of course wink

Signature

Rank

Total Posts: 24

Joined: May 6, 2005

PM

Ignore

 

Nicolas,

I’m going to try downgrading later today and see if that does anything.  It will clearly indicate or eliminate Template Morsels as the issue in any case.

If it ends up pointing at Template Morsels more definitively I’ll get you a login/pass to our dev server for both EE and FTP (which also has the latest template morsel running on it so you can experiment directly).

Jamie

Avatar
RankRankRankRankRank

Total Posts: 9901

Joined: Jan 8, 2009

PM

Ignore

 

Sounds good. Let me know how that goes. smile

I may sound obnoxious repeating this often, but please make sure you have good backups ready in case something goes wrong and you need to restore your installation to a working state wink

Signature

Rank

Total Posts: 24

Joined: May 6, 2005

PM

Ignore

 

Besides my normal backups all my code lives inside of a subversion repository.  So reverting if something blows up is usually pretty easy, but I’ll be backing up the database before this of course as well.  smile

Jamie

Rank

Total Posts: 24

Joined: May 6, 2005

PM

Ignore

 

Alright so reverting didn’t work.  Still unusual server load.  So it must be something I’ve done or that has changed that I’m not thinking of.

Avatar
RankRankRankRankRank

Total Posts: 9901

Joined: Jan 8, 2009

PM

Ignore

 

Alright, so it might not be a direct Template Morsel issue after all, but nevertheless, what I would recommend would be to create a simple template with first static text and see if it renders quickly.
Then I would try with very simple code (eg. an {exp:channel:entries} loop with a few entries only), no morsels.
Then I would add a simple morsel and check again if performance is affected.
Basically, go from very simple to more and more complex code while observing performance.

If all three appear to render quickly, I guess I would move on to reviewing main templates and look out for any parsing order issues, embedded tag loops, etc. Hope this helps smile

Signature