We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38136
    • 42 Posts
    Hi,

    i recently setup a revo 2.2.1. I needed to migrate the database form the old website. It is a website of events and the database starts at 2006. So up to now i have around 3000 resources and three times more TV values.

    The problem now is that i am not happy with the performance of the install. The server is hosting several MODx Installs. But none of them is that large. I am using PHP5.3, mod_fastcgi and MySQL 5.1.

    I played around with the supercache plugin. But i don't know wether that is a good solution.

    There is a parent which has around 99% of the resources as child and i am using getResource and getResourceField to work with that data from there.

    In the frontend of the website i have performance rates of 9 to 11 seconds up to the side is showing up. In the server stats i am seeing a tremendous amount of load (peaking ~1.5) at access.

    Well, how can i tweak the caching? how can i tweak the data or even the system? I need to roll out the website soon. So the time is runing.

    Some ideas? Do u need more informations?

    thx & greetings
      • 34030 ☆ A M B ☆
      • 23 Posts
      Hi,

      Are you calling the snippets cached or uncached?
        • 38136
        • 42 Posts
        I am using getResourceField cached. By the way i am using it inside of getResource. Which i on the other hand have to use uncached.

        The events of that website are changing every day. So i need to care for caching in that way.

        where can i manipulate the caching time of resources by default?

        thx
          • 38136
          • 42 Posts
          for testing i truncated the modx_site_tmplvar_contentvalues db table. It had about 4450 entries so far. but also with null entries it seems to a bad performance.

          I ll test the templates in the next step.
            • 4172
            • 5,888 Posts
            I think its a better idea to store the events not in resources, but in a custom-table and cache all parse-results.
            Clear or refresh the cache-files, every time modifications are done.
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 38136
              • 42 Posts
              well, the data is in the database now. It is plenty of work to redistribute it. Coz there are also a lot of depencies. In my experience it is not a proplem from the matter of database to store a lot fo data in the database. I have some databases at this server which are filled with around 1.2G of BLOB and TEXT data and the performance is really better this database of modx with just 3Meg of TEXT data only.

              Also i have a idea about the fastcgi. Might it be that modx is not runing well with that? I mean i am runing php as cgi. So i see a hug amount of memory load and cpu load when i am working at this project. Normaly that is not so much.
                • 4172
                • 5,888 Posts
                well, than.

                what is time-consuming mostly is parsing and replacing of placeholders and snippet-tags, and if you have a lot of TVs, pulling and processing them all. sometimes unresolved output-filters and all that.

                I still think you should cache the getresources-snippet somehow.
                What does this getResourceField-tags do inside your getResources-tpl ?
                How looks your getResources-tpls?
                How looks your getResources-snippet-tags?
                some Code?
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 38136
                  • 42 Posts
                  at each event there are playing some bands. So i need to call the band profile from the band resource. for that i put a getResource Snippet in the template as following. in the event resource is a TV which is called events.band. it is a resource list. so it is posible to asign a band to a specific event.
                  [[*content:notband=`[[*id]]`:notempty=`
                  	<div id="wrapper_content">
                  	  <div id="content" class="padit">
                  	    [[*content]]
                  	  </div>
                  	</div>
                  	`]]
                  [[getResources?
                    &parents=`-1`
                    &resources=`[[*events.band]]`
                    &hideContainers=`1`
                    &showHidden=`1`
                    &includeContent=`1`
                  
                    &includeTVs=`1`
                    &processTVs=`1`
                  
                    &tpl=`bands.portraitTpl`
                    &limit=`1`
                  ]]


                  The bands.portraitTpl is looking like following:
                  <div id="wrapper_band">
                    <div id="band" class="padit">
                      <h2>[[+pagetitle]]</h2>
                      <div class="band_data"> 
                        [[+tv.bands.thumb:notempty=`<img src="[[+tv.bands.thumb]]" alt="" class="band_thumb" />`]]
                        [[+tv.bands.website:notempty=`<a onclick="window.open(this.href); return false;" href="http://[[+tv.bands.website]]"><img src="[[+base_url]]/images/w2_long_website.png" alt="[[+tv.bands.website]]" /></a>`]]
                        [[+tv.bands.facebook:notempty=`<a onclick="window.open(this.href); return false;" href="http://facebook.com/[[+tv.bands.facebook]]"><img src="[[+base_url]]/images/w2_long_facebook.png" alt="facebook" /></a>`]]
                        [[+tv.bands.myspace:notempty=`<a onclick="window.open(this.href); return false;" href="http://myspace.com/[[+tv.bands.myspace]]"><img src="[[+base_url]]/images/w2_long_myspace.png" alt="myspace" /></a>`]]
                        [[+tv.bands.google:notempty=`<a onclick="window.open(this.href); return false;" href="https://plus.google.com/[[+tv.bands.google]]"><img src="[[+base_url]]/images/w2_long_googleplus.png" alt="google plus" /></a>`]]
                        [[+tv.bands.twitter:notempty=`<a onclick="window.open(this.href); return false;" href="http://twitter.com/[[+tv.bands.twitter]]"><img src="[[+base_url]]/images/w2_long_twitter.png" alt="twitter" /></a>`]]
                        [[+tv.bands.lastfm:notempty=`<a onclick="window.open(this.href); return false;" href="http://last.fm/[[+tv.bands.lastfm]]"><img src="[[+base_url]]/images/w2_long_lastfm.png" alt="last fm" /></a>`]]
                  .... markup here ...
                      [[+description:notempty=`<p>[[+description]]</p>`]]
                      [[+introtext:notempty=`<p>[[+introtext]]</p>`]]
                      [[+content]]
                      [[+tv.bands.youtube:notempty=`
                      <object .... [[+tv.bands.youtube]] .... </object>
                      `]]
                      <div class="clear"></div>
                    </div>
                  </div>


                  thx
                    • 18373 ☆ A M B ☆
                    • 3,141 Posts
                    Do you need to process the TVs? Ie &processTVs=`1` in the snippet call? That's very expensive in terms of processing and could very well bump performance up a ton, and I don't think I see anything that needs processing in that stuff you posted.

                    Now, you say you have it uncached because it's updated nearly daily, but the events are resources, right? In that case, it really wouldn't be needed to uncache them as a resource save means the cache is cleared smiley So you can have it generate it from cache only when something changed.
                      Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                      Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                      • 38136
                      • 42 Posts
                      Well, you are right. I put away &processTVs. Actually I do not need it. But it still needs around 9 seconds to render the page and put it to the cache. I thing thats still a lot.

                      It might be that i do not understand something about the modx resource caching. But i have a lot of content which need to be up to date. At the front page for example are the next 8 events shown. And the for the next event is a content truncated comming up section. Isn't it that this will not been updated when i call it cached?

                      thx