We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38357
    • 178 Posts
    Hi all,
    Using Rev 2.2.8 on a shared server running Cloud Linux and Cpanel.

    When accessing the manager interface I am getting huge Virtual Memory spikes every time the Resources or Elements trees are refreshed. This results in an 'Internal Server Error' because the Virtual Memory Limit of 1Gb is exceeded. I note that CPU usage also spikes at the same time. I have to refresh the trees to be able to see the content.

    Cannotallocate memory: couldn't create child process: /opt/suphp/sbin/suphp
    for /home/mysite/public_html/index.php, referer:
    http://www.mysite.com.au/manager/index.php?a=10&id=5

    Users accessing the website never appear to cause any excess memory usage - it is only the management interface.

    How can I prevent this problem? Are there any caching or Back-end Manager settings I could review to overcome this?



    Thanks [ed. note: bobd72 last edited this post 12 years, 10 months ago.]
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You can try turning off CSS and JS compression.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 27708 MODX Staff
        • 2,502 Posts
        I know for a fact that the way CloudLinux is partitioned by default in most cases will cause problems with the MODX Manager. According to A2 Hosting's team they had to increase the virtual memory limit from 2GB to 8GB. This didn't negatively affect the anything else and they were able to keep the 1GB physical memory still in place.

        According to their research this is because CloudLinux introduced a new concept of virtual memory and physical memory. Their stats are showing sites were nowhere near hitting the physical memory limit but the virtual memory limit was getting inherited from the Apache memory usage as well, apparently.

        This seems to have resolved all reported issues they were having. That being said, as Susan noted, you should disable CSS/JS compression as it can slow the manager on most environments.
          Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
          • 3749
          • 24,544 Posts
          It's unlikely, but it's possible to have a resource that is its own parent or two resource that are each other's parent. That might suck memory when the Resource tree is rendered.

          There is also the clear_cache_refresh_trees System Setting. Turning that off might help.

          All that said, I think Jay is probably right about it being CloudLinux.
            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
            • 38357
            • 178 Posts
            Quote from: sottwell at Nov 22, 2013, 08:04 AM
            You can try turning off CSS and JS compression.
            Thanks Susan - I tried turning it on thinking that would help, but it completely wrecked the manager interface - all I could get was the menu and that wouldn't work I ended up having to go into the database to change the compression settings to get manager access back. using compression was not a good idea smiley [ed. note: bobd72 last edited this post 12 years, 10 months ago.]
              • 38357
              • 178 Posts
              Quote from: smashingred at Nov 22, 2013, 09:00 AM
              I know for a fact that the way CloudLinux is partitioned by default in most cases will cause problems with the MODX Manager. According to A2 Hosting's team they had to increase the virtual memory limit from 2GB to 8GB. This didn't negatively affect the anything else and they were able to keep the 1GB physical memory still in place.
              According to their research this is because CloudLinux introduced a new concept of virtual memory and physical memory. Their stats are showing sites were nowhere near hitting the physical memory limit but the virtual memory limit was getting inherited from the Apache memory usage as well, apparently.
              This seems to have resolved all reported issues they were having.
              Thanks Jay,
              I had similar problems 7 months ago and thought Cloud Linux may be the problem as it only appeared when my account was changed to a new server. After much discussion with the help desk the problem suddenly disappeared - they denied making any changes. Now, exactly 7 months later it has reappeared. If I can define exactly what is causing the problem at least I can hold up my end of the discussion to reach a solution. My Virtual memory allowance is only 1Gb so there is no way they will increase it to 8gb

              When the memory limit is exceeded the message 'Cannot allocate memory: couldn't create child process:' is generated. Why would ModX be so resource hungry when trying to create a child process, or is it really something else?
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                If this "virtual memory" includes the web server's memory use, PHP memory use and MySQL memory use, it could well be that the way xPDO optimizes and caches queries could be at least part of the problem. It's always a tradeoff between speed, processor and memory.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 38357
                  • 178 Posts
                  Quote from: BobRay at Nov 22, 2013, 11:14 AM
                  It's unlikely, but it's possible to have a resource that is its own parent or two resource that are each other's parent. That might suck memory when the Resource tree is rendered.

                  There is also the clear_cache_refresh_trees System Setting. Turning that off might help.

                  All that said, I think Jay is probably right about it being CloudLinux.
                  Thanks Bob. I already have clear_cache_refresh_trees turned off :-(
                    • 38357
                    • 178 Posts
                    Quote from: smashingred at Nov 22, 2013, 09:00 AM


                    According to their research this is because CloudLinux introduced a new concept of virtual memory and physical memory. Their stats are showing sites were nowhere near hitting the physical memory limit but the virtual memory limit was getting inherited from the Apache memory usage as well, apparently.
                    The information you provided enabled me to convince my hosting providers to increase Virtual Memory limit to 2Gb - not perfect but a lot better than it was. I only get the odd server error now and it is quite useable.

                    Thanks for the information and assistance - it is greatly appreciated.

                    Is this an issue that could be considered for improvement of Modx in the future or a problem for hosting companies/Cloud Linux to address?

                      • 27708 MODX Staff
                      • 2,502 Posts
                      @bobd72 unfortunately, this is an issue of the way many hosts are configuring (or not) their CloudLinux installs. My understanding is that many use the default settings for memory which has not been tested widely for web application support. It's design is to allow Cloud hosting providers to strongly partition resource usage on a per account basis and not for optimal hosting performance of the account owner.
                        Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub