<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" 
      xmlns:thr="http://purl.org/syndication/thread/1.0">
  <link rel="alternate" type="text/html" href="http://forums.movabletype.org/2009/03/caching-woes.html" />
  <link rel="self" type="application/atom+xml" href="http://forums.movabletype.org/atom.xml" />
  <id>tag:forums.movabletype.org,2011://24/tag:forums.movabletype.org,2009://24.13527-</id>
  <updated>2011-09-01T02:26:10Z</updated>
  <title>Comments for Caching woes.</title>
  
  <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.292</generator>
  <entry>
    <id>tag:forums.movabletype.org,2009://24.13527</id>
    <link rel="alternate" type="text/html" href="http://forums.movabletype.org/2009/03/caching-woes.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.movabletype.org/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=24/entry_id=13527" title="Caching woes." />
    <published>2009-03-25T16:51:56Z</published>
    <updated>2009-03-25T19:53:43Z</updated>
    <title>Caching woes.</title>
    <summary>Before I dig deeper in to what is happening here I wanted to see if someone else encountered this problem and had a solution worked. I&apos;m working with MT 4.23 Pro with the community patch applied and an unchanged Mid-Century...</summary>
    <author>
      <name>Timothy Appnel</name>
      <uri>http://appnel.com/</uri>
    </author>
    
    <category term="Performance" />
    
    <content type="html" xml:lang="en" xml:base="http://forums.movabletype.org/">
      <![CDATA[<p>Before I dig deeper in to what is happening here I wanted to see if someone else encountered this problem and had a solution worked.</p>

<p>I'm working with MT 4.23 Pro with the community patch applied and an unchanged Mid-Century Template Set along with client content (6426 entries) and assets (12262 images) that I imported.</p>

<p>Rebuilds are extremely slow (how slow we'll see in a minute) so I turned on performance logging and went in to DebugMode 12 to get slow template build and D:OD queries reports.</p>

<p>My sidebar module is cached. I have memcached running and have tried caching using that and Apache SSI methods. </p>

<p>In the performance log I get entries like these while rebuilding.</p>

<p>[Wed Mar 25 16:18:09 2009] domU-12-31-38-00-A4-C4 pt-times: pid=28221, uri=[/mt/admin?next=0&start_time=1237997514&total=6238&entry_id=&old_next=&old_previous=&is_new=&__mode=rebuild&limit=&type=Individual&old_status=&blog_id=9&offset=4], mem_start=7608, mem_end=61912, tag_assets[type:image]=62.47898, Total=70.54554<br />
[Wed Mar 25 16:19:22 2009] domU-12-31-38-00-A4-C4 pt-times: pid=28249, uri=[/mt/admin?next=0&start_time=1237997514&total=6238&entry_id=&old_next=&old_previous=&is_new=&__mode=rebuild&limit=&type=Individual&old_status=&blog_id=9&offset=5], mem_start=7608, mem_end=61956, tag_assets[type:image]=61.42105, Total=70.22215</p>

<p>Inidividual entries are taking 70 seconds to build and MT is only building one per iteration (note the offset). This is also reporting that mt:assets is taking up most of the time that I've tracked down to the Galley module. This is why I have to cache that module and more.</p>

<p>If I remove (ignore) the sidebar I see performance numbers I'd expect:</p>

<p>[Wed Mar 25 16:33:15 2009] domU-12-31-38-00-A4-C4 pt-times: pid=28461, uri=[/mt/admin?next=0&start_time=1237998784&total=6238&entry_id=&old_next=&old_previous=&is_new=&__mode=rebuild&limit=&type=Individual&old_status=&blog_id=9&offset=40], mem_start=7604, mem_end=28636, Total=2.96603<br />
[Wed Mar 25 16:33:20 2009] domU-12-31-38-00-A4-C4 pt-times: pid=28464, uri=[/mt/admin?next=0&start_time=1237998784&total=6238&entry_id=&old_next=&old_previous=&is_new=&__mode=rebuild&limit=&type=Individual&old_status=&blog_id=9&offset=80], mem_start=7608, mem_end=28596, Total=2.96874</p>

<p>Just under 3 second for 40 entries is acceptable.</p>

<p>With the sidebar in and caching turned on I noticed some odd calls from the Data::ObjectDriver queries:</p>

<p>		DELETE FROM mt_asset_meta WHERE (asset_meta_asset_id = ?) AND (asset_meta_type = ?) : 0.035363s / 441 = 0.000080s avg (first 0.000063s, min 0.000002s, max 0.000476s)</p>

<p>		UPDATE mt_asset SET asset_file_ext = ?, asset_modified_on = ?, asset_created_on = ? WHERE (asset_id = ?) : 0.079201s / 361 = 0.000219s avg (first 0.000083s, min 0.000002s, max 0.031106s)</p>

<p>Why are these happening during a rebuild? Could this be why the sidebar and gallery keeps rebuilding and killing performance? BTW: I only have the packaged plugins in use and even some of those I have disabled.</p>

<p>As I understand the expire on event mode of caching, these would trigger that event and clear out the cache. That said using a TTL of 30 minutes did help either.</p>

<p>Any thoughts, tips or tricks would be appreciated.</p>]]>
      
    </content>
  </entry>

  <entry>
    <id>tag:forums.movabletype.org,2009://24.13527-comment:20851</id>
    <thr:in-reply-to ref="tag:forums.movabletype.org,2009://24.13527" type="text/html" href="http://forums.movabletype.org/2009/03/caching-woes.html"/>
    <link rel="alternate" type="text/html" href="http://forums.movabletype.org/2009/03/caching-woes.html#c20851" />
    <title>Comment from Jay Allen on 2009-03-25</title>
    <author>
        <name>Jay Allen</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>1. Is this under FastCGI?<br />
2. The SQL for assets may be those for thumbnail generation.  Possible?<br />
3. Not sure what the "Galley module" is, but sounds like you have a winner.  Search and destroy!</p>]]>
    </content>
    <published>2009-03-25T19:25:57Z</published>
  </entry>

  <entry>
    <id>tag:forums.movabletype.org,2009://24.13527-comment:20853</id>
    <thr:in-reply-to ref="tag:forums.movabletype.org,2009://24.13527" type="text/html" href="http://forums.movabletype.org/2009/03/caching-woes.html"/>
    <link rel="alternate" type="text/html" href="http://forums.movabletype.org/2009/03/caching-woes.html#c20853" />
    <title>Comment from Byrne Reese on 2009-03-25</title>
    <author>
        <name>Byrne Reese</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>From IM:</p>

<p>byrnereese: the assets being deleted might have something to do with asset thumbnail generation<br />
[12:42pm] byrnereese: however that shouldn't happen<br />
[12:43pm] byrnereese: but that seems like the most likely candidate for a bug<br />
[12:43pm] tappnel: that is another problem i am having.<br />
[12:43pm] byrnereese: my guess is that MT is deleting and then regenerating the thumbnail for every page<br />
[12:43pm] tappnel: i imported all of these assets and...<br />
[12:43pm] tappnel: the manage assets displays a "missing image" message and icons.<br />
[12:44pm] tappnel: yet at the same time I can click the view asset link and see the file<br />
[12:44pm] byrnereese: i wonder if the import wasn't performed properly<br />
[12:44pm] tappnel: and that file displays in the entry.<br />
[12:44pm] byrnereese: or something<br />
[12:44pm] tappnel: perhaps.<br />
[12:44pm] byrnereese: here is an experiment<br />
[12:44pm] byrnereese: try installing MC into a separate blog<br />
[12:44pm] tappnel: i was trying to figure out how you force thumbnail generation.<br />
[12:44pm] byrnereese: add some assets the normal way<br />
[12:45pm] byrnereese: turn on debugging and see if you keep seeing MT make those mt_asset db calls<br />
[12:45pm] tappnel: OK.<br />
[12:45pm] byrnereese: if you do then there is a bug in MT that needs to get fixed obviously<br />
[12:45pm] tappnel: I did post an image through the WYSIWYG and that worked as it should.<br />
[12:45pm] byrnereese: if not, then I would suspect that the import was not done properly.<br />
[12:45pm] byrnereese: MT is probably simply having difficulty finding the actual cached thumbnail on disk<br />
[12:46pm] byrnereese: so it deletes a record of it<br />
[12:46pm] tappnel: I will try it in another blog and see what happens there.<br />
[12:46pm] byrnereese: and recreates it<br />
[12:46pm] byrnereese: it might also be a permissions issue in assets_c<br />
[12:46pm] byrnereese: maybe<br />
</p>]]>
    </content>
    <published>2009-03-25T19:48:43Z</published>
  </entry>

  <entry>
    <id>tag:forums.movabletype.org,2009://24.13527-comment:20855</id>
    <thr:in-reply-to ref="tag:forums.movabletype.org,2009://24.13527" type="text/html" href="http://forums.movabletype.org/2009/03/caching-woes.html"/>
    <link rel="alternate" type="text/html" href="http://forums.movabletype.org/2009/03/caching-woes.html#c20855" />
    <title>Comment from Timothy Appnel on 2009-03-25</title>
    <author>
        <name>Timothy Appnel</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>1. Not under FastCGI. This is a development environment that I didn't want to keep restarting each time I make a change to the system or some code.</p>

<p>2. Perhaps. That is another issue I'm having. All the images I imported display a missing image message and icon when I go into manage > assets. I'm not getting any errors from the web or command line though.</p>

<p>3. GalleRy module. It's displayed at the top of the side bar picture of the homepage screen shot here:</p>

<p><a href="http://www.movabletype.org/documentation/themes/mid-century.html" rel="nofollow">http://www.movabletype.org/documentation/themes/mid-century.html</a></p>

<p>Thing is the latest entries and comment modules are being repetitively rebuilt unnecessarily slowing down rebuilds. The mt:assets markup in the Gallery module is a worse offender.</p>]]>
    </content>
    <published>2009-03-25T19:53:43Z</published>
  </entry>

</feed>

