We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26503
    • 620 Posts
    Seems like the front end of the site is abnormally slow - even compared to other modx sites I have hosted on the same server, I was wondering if anyone had a tuning faq/pointers, gotchas that I can look into to try and boost the front end performance...

    I grabbed some page load times [with a little code snip from another thread}
     
    MySQL: 0.0006 s, 2 request(s), PHP: 4.2241 s, total: 4.2247 s, document retrieved from database. 
    MySQL: 0.0002 s, 2 request(s), PHP: 2.3721 s, total: 2.3723 s, document retrieved from cache. 
    
    MySQL: 0.0002 s, 2 request(s), PHP: 4.3044 s, total: 4.3046 s, document retrieved from database.
    MySQL: 0.0002 s, 2 request(s), PHP: 2.4450 s, total: 2.4452 s, document retrieved from cache.
    
    MySQL: 0.0002 s, 2 request(s), PHP: 4.1951 s, total: 4.1953 s, document retrieved from database. 
    MySQL: 0.0002 s, 2 request(s), PHP: 2.7613 s, total: 2.7615 s, document retrieved from cache. 
    
    [homepage]
    MySQL: 0.0001 s, 1 request(s), PHP: 7.0951 s, total: 7.0952 s, document retrieved from database.
    MySQL: 0.0001 s, 1 request(s), PHP: 3.4364 s, total: 3.4365 s, document retrieved from cache. 
    
    


    You can see the cache load times are about half of what is loaded from the database [as expected] & the mysql activity is trivial.
    the site is in development right now, I’ve combined all the css/js etc. run them through gzip via htaccess all that’s missing is CDN however - this is all looking like php running time [I think]

    I tried ’optimizing’ the database - nada - I don’t see anything ’off’ in the modx error logs - a little stumped right now.. any thoughts?

    Server = Centos media temple DV3
    MODx Revolution 2.0.8-pl (traditional)
    MySQL 5.0.22
    PHP 5.2.5



    What else can I look at?


    Oh there is one thing... I’m using getResources a lot [A LOT] there are at least 6 instances of it on the home page [all called cached] & I’m also using the [[If]] add on a fair amount probably 3x in the main template.... are there any known performance issues with either of these?



    -thanks
    -sean



      *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

      Sean Kimball CLP, CLS.
      Technical Director / Sr. Developer | BigBlock Studios
      ._______________________________________________.
      Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
      27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
      phone/fax: 905-426-5525
      • 3749
      • 24,544 Posts
      You can try putting a space between the first two brackets of the getResources tags. That will take them out of play and you can see how much it improves performance. If you are using &includeContent, &processTVs, and/or a complex &where clause, those could create performance issues.

        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 22303 MODX Staff
        • 10,725 Posts
        You can also use The Executioner to check the time taken by any uncached Snippets or Chunks being parsed.
          • 26503
          • 620 Posts
          Weird - I thought I had replied to this, I took Bob’s advice [sometimes the simplest solutions are the most elusive eh??] & found that I was calling wayfinder multiple times uncached - as soon as I started calling the cached version, load times went down by at least half - more on some templates.

          Thanks Jason: I will look into the executioner anyway, since I am not 100% where I want to be ~performance-wise~ which I can probably do if I try to optimize wayfinder even further [i.e. get it to the point where I only have to call it twice/page (header & footer navigation)]

          One question about caching just occurred to me ~ and I haven’t checked the docs/forum yet, so forgive me if this is clearly documented ~

          How does the "clear cache on save" feature work in a document resource? does it
          1) clear the entire site cache.
          2) clear just the cache for that resource
          3) clear the cache for that resource & all children [TV’s snippets etc] or
          4) work in some other way

          -thanks
          -sean
            *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

            Sean Kimball CLP, CLS.
            Technical Director / Sr. Developer | BigBlock Studios
            ._______________________________________________.
            Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
            27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
            phone/fax: 905-426-5525
            • 22303 MODX Staff
            • 10,725 Posts
            Quote from: sean69 at May 24, 2011, 12:49 PM

            How does the "clear cache on save" feature work in a document resource? does it
            1) clear the entire site cache.
            2) clear just the cache for that resource
            3) clear the cache for that resource & all children [TV’s snippets etc] or
            4) work in some other way
            Basically 1 — it clears the entire cache for the Context the Resource is in.
              • 26503
              • 620 Posts
              hmm interesting;

              is that the best way to do it? i.e. for very large sites with long cache lifetimes [like a couple days] I would think that refreshing just the resource in question would be a better option.
              Or the option to be able to refresh certain parts of the cache in admin as a feature request ...

              I realize the caching feature is pretty involved as it is, but this would be a handy option I think...

              Just noodling.

              -thanks again
              -sean
                *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

                Sean Kimball CLP, CLS.
                Technical Director / Sr. Developer | BigBlock Studios
                ._______________________________________________.
                Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
                27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
                phone/fax: 905-426-5525