Support » Fixing WordPress » Hitting Host's 500 MB Memory Usage (RAM) Limit

  • Hi Everyone,

    My hosting provider is in the process of upgrading to CloudLinux, which enables them to impose memory usage (RAM) limits on each account on a server. The limit they’ve imposed is a 500MB cap. They’re doing this to keep one site/account from monopolizing resources and slowing down the others and/or causing outages.

    I have multiple wordpress sites hosted with them, a few on differing servers (it’s a reseller account), and now all of my sites are running into issues loading because they are hitting the memory usage limits.

    In any case, the entries in my site’s error log all look something like this:

    [Thu Apr 28 14:50:51 2011] [error] [client] (12)Cannot allocate memory: couldn’t create child process: /opt/suphp/sbin/suphp for /home/zicl/public_html/wp-content/themes/headway-101/media/css/layout.php, referer:

    [Thu Apr 28 15:00:27 2011] [error] [client] (12)Cannot allocate memory: couldn’t create child process: /opt/suphp/sbin/suphp for /home/imq/public_html/wp-content/themes/headway-101/media/css/typography.php, referer:

    And the WP errors logs have entries like this:

    [28-Apr-2011 04:32:37] PHP Fatal error: Out of memory (allocated 20447232) (tried to allocate 131072 bytes) in /home/imq/public_html/wp-includes/functions.php on line 3071

    [27-Apr-2011 23:53:05] PHP Fatal error: Out of memory (allocated 18087936) (tried to allocate 78 bytes) in /home/zicl/public_html/wp-includes/formatting.php on line 949

    The host is, of course, blaming the issue on WP and my plugins/themes. However, the sites all use themes from popular providers such as Thesis, Headway, Studiopress, and WooThemes. Most sites only have 1-3 plugins, all of which are popular and vetted by many users. No caching plugins, no cron jobs, etc. Nothing resource-heavy. These are cpanel accounts, and most have fewer than 500 visits/day and between 50-1000 pages/posts.

    My question is, should 500MB RAM memory usage limit be too low to run WP? Or does every one of my sites have some kind of issue that makes them take up more memory than they should? They were built at different times, on different servers, with different themes, and so I am kinda at a loss here.

    If anyone could provide any insight, I would be very, very, very appreciative. I am really stressed right now, as I’ve worked my tail off for years to build a business that supports my family, and right now my income has been cut back to a trickle.

Viewing 15 replies - 16 through 30 (of 34 total)
  • Total, I’m managing about 30 sites that have this problem. It’s shared hosting through a reseller account. All separate sites.

    Here’s an example of the error log. Strangely, it seems to be a different file each time.

    [Thu Apr 28 15:00:36 2011] [error] [client] (12)Cannot allocate memory: couldn’t create child process: /opt/suphp/sbin/suphp for /home/imq/public_html/index.php, referer:

    [Thu Apr 28 15:00:36 2011] [error] [client] (12)Cannot allocate memory: couldn’t create child process: /opt/suphp/sbin/suphp for /home/imq/public_html/index.php, referer:

    [Thu Apr 28 15:00:32 2011] [error] [client] (12)Cannot allocate memory: couldn’t create child process: /opt/suphp/sbin/suphp for /home/imq/public_html/wp-content/themes/headway-101/media/css/colors.php, referer:

    [Thu Apr 28 15:00:27 2011] [error] [client] (12)Cannot allocate memory: couldn’t create child process: /opt/suphp/sbin/suphp for /home/imq/public_html/wp-content/themes/headway-101/media/css/typography.php, referer:

    See anything that jumps out at you?

    Moderator Ipstenu (Mika Epstein)


    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    Yeah. suphp. I’ve run into problems with it before when it’s not configured to share memory well, and sadly I don’t know of a good solution :/

    What kind of reseller account? Do you really mean you’re on totally shared hosting? You may be better off on a VPS.

    Yeah, I think it’s totally shared. You pick a server from one of like 6 locations (4 in the US), but you’re on a shared server.

    Right now I’m looking into HostGator VPS.

    But I’d like to have some IP diversification, just because it’s a good many sites in at least somewhat related fields, although very high-value on the whole and unique content.

    So I was thinking about going with HostGator’s Level 6 VPS plan, which offers 2304MB of RAM.

    But if I have, say, 4 sites on VPS, each hitting 500+MB RAM usage on an hourly basis, it’s not going to be long before I’m overtaxing the server, right?

    Does anyone have any pointers as far as how to diagnose where the memory problems are coming from? I upgraded my theme (Headway) to the newest version and installed WP Super Cache on a couple of sites, and the problems have diminished somewhat, but each site is still hitting that 500MB memory usage limit multiple times per hour. If you sit and refresh any of the sites, you will inevitably run into them not loading properly.

    My host is claiming that only 1/10 of 1% of accounts are hitting the 500MB limit, so I’m just trying to figure out how in the heck my sites are consuming so much RAM.

    Any pointers, suggestions, advice, insight, hunches, criticisms…anything would be greatly appreciated.

    Thank you!!

    Moderator Ipstenu (Mika Epstein)


    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    A couple thoughts.

    First off, being on a VPS means that even if you do have 4 sites with spikes, the odds are that they WON’T all spike at once. And being on a VPS means you don’t share with as many people, so the spare cycles will be there to spare, AND you can optomize your VPS specifically for WP (like putting on APC or some server caching, tuned to your sites).

    Secondly, you may want to consider WordPress MultiSite to consolidate. It will use, I think, less CPU/memory for multiple sites like that then will separate installs.

    Thanks so much, Ipstenu. I didn’t think of that: the sites most probably won’t spike all at once.

    Does anyone know how to check memory (RAM) usage on a site with shared hosting?

    I want to see if sites I’ve moved off of the CloudLinux servers are using just as much memory as before.

    Moderator Ipstenu (Mika Epstein)


    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    Depends on the host, really. You may be able to check via the top command in unix shell if they don’t have an interface.

    Thanks, Ipstenu. I am, unfortunately, not that knowledgeable when it comes to this stuff, and my hosting provider has basically said that they can’t, at this time, accurately pinpoint the cause of high memory usage on either their regular shared servers or those which have been upgraded to CloudLinux.

    I’ve employed a WP ninja to put several of the sites on test servers for a few days and see if he can pinpoint the issue. I’ll update this thread when we learn something.

    Anybody know to what extent memory faults could have a deleterious effect on search rankings? We know Google’s algo looks at load time and the like.

    Many of my sites now appear fine (after installing WP Super Cache and updating themes where possible); however, they are still consistently getting memory faults. So I’m wondering to what extent will Google’s spiders see these faults, and to what extent this could affect rankings.

    I am trying to decide whether I should rush to move the sites to another host, to minimize this risk, as opposed to waiting for the results from my WP ninja’s analysis.

    Any advice would be greatly appreciated!


    Sorry this is so long – lots of info to share around this same issue recently.
    I moved just one very successful site to a new VPS level 4 because it had high traffic & the server was disabling it due to overload. There were many pages not found 404 errors that were calls to pages with urls ending like: inc/loading.gif, /inc/x.png and /inc/restore.png which are non-existant urls in my site.
    Traffic was hitting 1500 to 1800 visitors/day

    So, at the recommendation of HG & other IM experts, I opened the new VPS 4 account with just that one site transferred to it. Since the transfer those 404 errors are still coming in droves and now in my new error log on VPS cpanel there are hundreds of a new type of error that BrownDog is getting
    12)Cannot allocate memory: couldn’t create child process: /opt/suphp/sbin/suphp for etc

    So installing the W3 total cache did not solve the problem and then switching up to the VPS did not solve it either, just created a new one the same as BrownDogs.

    HG Support allocated more memory twice to my account, but still getting the memory allocation errors

    HG support NOW says: “As for the server memory allocation error, it looks like the errors are a result of exhausting the server’s memory, though I can only speculate as the server load is very low at this time with a lot of memory available. You already have W3 total cache installed so you’re covered in that department.

    There are other caching methods on a serverwide basis, such as Eaccelerator or Memcached which can be installed on your server, some of which are free and others we can install for a price. If you’d like more information on having a caching program installed you can email and they can monitor loads on the server and make a recommendation as to what can be done to keep the loads on your server low.”

    “The pages not found 404 errors are related to search engine crawlers, perhaps looking for different images to map to the search engine. It’s not uncommon for those to show in the stat logs, and it may be beneficial to block certain search engines from crawling images. This can be setup with a robots.txt file:”

    I have no idea what to do now. Thanks for all the info, I’ll follow what’s happening with BD & keep this thread posted of any bright ideas I can get support to come up with.

    BTW Here are the specs for a HG VPS level 4 account
    CPU 1.98 GHZ
    RAM 1344 MB
    Disk Space 59 GB
    Bandwidth 1050 GB

    Thanks for the info, bcgear. I am no expert on this, but the WP expert who’s been helping just suggested today that I edit the robots.txt file as per the instructions here:

    He said that with an open robots.txt and WP, the search crawlers go through a bunch of stuff they don’t need to see – WP core files, plugins, config, etc. A robots.txt file like the one below…

    User-agent: *
    Disallow: /feed/
    Disallow: /trackback/
    Disallow: /wp-admin/
    Disallow: /wp-content/
    Disallow: /wp-includes/
    Disallow: /xmlrpc.php
    Disallow: /wp-

    …seems like it might minimize those 404 errors. People with more expertise than me on this can chime in, though.

    Thanks BrownDog
    I was trying to figure out just how to set up the robots.txt, I already added the Disallow: /feed/
    Disallow: /trackback/
    Disallow: /wp-admin/
    Disallow: /wp-content/

    I’ll try adding the others that I don’t already have like
    Disallow: /wp-includes/
    Disallow: /xmlrpc.php
    Disallow: /wp-
    Not too sure about Disallow: /wp- with no slash at the end though, is that just a typo?
    More chiming from an expert in robot.txt code to prevent 404 errors would be great.

    Man, I just don’t know. This is my first time modifying the robots.txt file for a WP site, and I actually haven’t done it yet. We better wait for an expert to chime in on this one…

Viewing 15 replies - 16 through 30 (of 34 total)
  • The topic ‘Hitting Host's 500 MB Memory Usage (RAM) Limit’ is closed to new replies.