We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22739
    • 11 Posts
    First off, I love Modx. It’s been a joy to work with. I built a portfolio website with Revolution 2.0. The site has a lot of large images, with the homepage weighing in at about 600K (not outrageous by today’s standards).

    Problem is that on initial page load, it regularly takes 7-8 seconds for anything to appear. There’s no progressive loading, everything just appears at once. Anyone have any ideas of why the site is so slow to render? Running the same website files outside of Modx is pretty zippy.

    I’m running:
    Revolution 2.0
    MySQL 4.1 (Media Temple grid hosting)
    PHP5

    thanks!
      • 22303 MODX Staff
      • 10,725 Posts
      Unless you have your own database container, I have found the response time of the database requests on the MT Grid service to be absolutely horrible. But it all depends on what Snippets etc. you are executing on your page( s ). You can also improve performance on the MT Grid service by enabling the cache_database system setting; this turns on result set caching from the database and greatly reduces the need for MODx to even access the database server.
        • 22739
        • 11 Posts
        Thanks for the tip, I’ll give that a shot. Pretty much the only snippet I’m running is getResources so I feel like it’s probably the grid service.
          • 23702
          • 6 Posts
          Just to update add to Patch’s post, we have our own MySQl container which is now running version 5. We have reduced the size of the images to about 320k. Media Temple has run several tests for me which indicate that something on our side is causing the home page to hang up. This last test has the site loading at 15+ seconds. http://tools.pingdom.com/fpt/?url=http://www.ponscreative.com/&id=3089142
            • 22303 MODX Staff
            • 10,725 Posts
            You might try this technique to see what Snippets on that Resource are executing slowly.
              • 23702
              • 6 Posts
              It seems that the culprit may be the getResources snippet. We have removed the snippet and loaded tested the site and it seems to load significantly faster (minus give or take 350k of images that are not showing up after removing the snippet)

              In your description in the download page you state that "getResources is NOT a replacement for Ditto, but rather an alternative component that can accomplish some of the things that the more specialized components do." With that being said, do you recommend we explore other components that serve the same functions, but are compatible with Revo? If so which one? Our other option could be to figure out why that particular snippet is causing such long load times and how to remedy the issue.

              Any thoughts?
                • 22303 MODX Staff
                • 10,725 Posts
                Quote from: ponscreative at Oct 09, 2010, 03:09 AM

                It seems that the culprit may be the getResources snippet. We have removed the snippet and loaded tested the site and it seems to load significantly faster (minus give or take 350k of images that are not showing up after removing the snippet)

                In your description in the download page you state that "getResources is NOT a replacement for Ditto, but rather an alternative component that can accomplish some of the things that the more specialized components do." With that being said, do you recommend we explore other components that serve the same functions, but are compatible with Revo? If so which one? Our other option could be to figure out why that particular snippet is causing such long load times and how to remedy the issue.

                Any thoughts?
                Are you not caching the results of getResources? And why is it taking so long? getResources is a fairly efficient snippet in most cases. Are you sorting by a Template Variable by chance? How many Resources are you fetching at once?
                  • 22739
                  • 11 Posts
                  Caching is turned on. We’re not sorting by a TV. There are approximately 10 getResources calls on the page and they’re fetching about 40 resources in total. The results are mostly images with some title and summary text.

                  I ran the executioner snippet (very helpful!) and all the getResources calls totaled up to approximately 2.5 seconds. Average page load time is 7-8 seconds so I’m truly stumped as to where the hang up is.
                    • 22303 MODX Staff
                    • 10,725 Posts
                    Quote from: patch at Oct 11, 2010, 08:22 PM

                    Caching is turned on. We’re not sorting by a TV. There are approximately 10 getResources calls on the page and they’re fetching about 40 resources in total. The results are mostly images with some title and summary text.

                    I ran the executioner snippet (very helpful!) and all the getResources calls totaled up to approximately 2.5 seconds. Average page load time is 7-8 seconds so I’m truly stumped as to where the hang up is.
                    Right, that 2.5 seconds should only be the first hit after the cache is cleared. So after the 10 getResources calls are cached, the page load should be negligible.

                    What other Snippets exist in your template or any element associated with this Resource? Any Plugins that are registered with parser Events?
                      • 22739
                      • 11 Posts
                      OpenGeek, thanks for all your help so far.

                      Once the calls are cached, everything on the site operates at normal speed. The main problem is the initial load of the homepage (which seems as though it’s hanging on something and then suddenly appears after 8 seconds). As a test, I took all the raw HTML and placed it in a new modx template with no getResources calls and the page loads in less than 2 seconds. The only other snippet on the page is SPForm (which I kept in the raw HTML template test).

                      I actually want to correct something from my previous reply. Some of the resources are being displayed by a Template Variable. I created a TV to the tune of "Feature This Item", and if checked, those resources are shown on the homepage. Is displaying resources by a TV a problem?