We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34174
    • 67 Posts
    I'm completely lost on this. I have a hosting account HA which was giving load issues on one server. I moved to a VPS on its own, yet within minutes it brings the VPS to a crawl.

    Running MODX 2.5.7. Using two contexts WEB and STAGING and XRouting. I disabled XRouting, thinking it could have been the cause. The load dropped. But what I didn't realise is that content was being served from the WEB context (it was supposed to be served from the STAGING context after a redesign a year or so ago). So everything's fine from WEB but not from STAGING. So I created a third context OLDSITE. Moved resources from WEB to OLDSITE and STAGING resources to WEB. I also changed around the context settings. But now it seems things got worse.

    Even after rebooting the server, content got served from the new WEB resources (the correct site) but the images were missing. And as I went into MODX Manager, it slowed to a crawl. Can't do anything. I tried changing site_available to 0 in phpmysql but even after clearing the cache folder, the site is still trying to bring up the front page.

    Also see attached. Not normal, is it?

    Any ideas?

    This question has been answered by [email protected]. See the first response.

      • 34174
      • 67 Posts
      Also I am running on PHP 7.0
        • 3749
        • 24,544 Posts
        Try watching the Network tab in Chrome Dev tools to see what's happening. The Performance tab may also help.

        You may have some kind of memory leak or a circular reference.
          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
        • discuss.answer
          • 34174
          • 67 Posts
          Thanks Bob

          I was able to sort out the problem on the server. I noticed that several broken images were showing as 500 errors instead of 404 errors in the error log.

          There is a custom javascript (that I did not write) that pulls different images depending on mobile/tablet/desktop device. The images for mobile devices did not have their paths set properly. So what I did was copied those files to the locations the js was looking. No more 500 errors in the log.

          I still don't understand why the 500 errors though. And I also don't understand why the server was bogged down because of it. Seems that everytime it got a 500 error, it remained as a process on the server.

          The way the JS was written, I would have never seen those errors on Chrome on the desktop...because it only grabs those images for phones.
            • 3749
            • 24,544 Posts
            One downside of having different images for different platforms.

            Maybe the JS was making an AJAX call to some poorly written error-reporting code?
              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
              • 34174
              • 67 Posts
              Could be. The js is pretty complex and I've run out of time to try to find where it's calling the images to change the paths there, so the images had to be copied.