WordPress.org

Forums

Hitting Host's 500 MB Memory Usage (RAM) Limit (35 posts)

  1. browndog82
    Member
    Posted 4 years ago #

    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 75.xxx.xx.xxx] (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: http://www.examplesite.com/wp-content/themes/headway-101/style.css

    [Thu Apr 28 15:00:27 2011] [error] [client 75.xxx.xx.xxx] (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: http://www.examplesite.com/wp-content/themes/headway-101/style.css

    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.

  2. Alok Tiwari
    Member
    Posted 4 years ago #

    This is most common problem:

    reason Plugin/theme developer uses plenty of resources
    That could be saved to avoid Slow loading sites

    Optimization is highly recommended. Find Some expert level coder with skills of handling Apache.

  3. browndog82
    Member
    Posted 4 years ago #

    Thanks Alok. But plenty of people use these themes everyday without problems, and they perform well for my users.

    Is 500MB a low memory usage limit. And if not, how can I determine why my sites are using so many resources?

  4. Alok Tiwari
    Member
    Posted 4 years ago #

    Memory Don't matter !
    If Matters How much Traffic over your site. And How much the resources your sites are taking.

    Optimization would always helps you to save critical CPU Cycles that otherwise is a waste. Because they are not being used for productivity.
    That is simply a continuous leakage.

    Anyway What's in general your Traffic stats says.
    In simple terms How many hits you are getting on average.

    Anyway give me your url Just want to check..

  5. browndog82
    Member
    Posted 4 years ago #

    Sorry -- not comfortable handing out my URL.

    And I was told by the host and other sources that traffic is not the issue.

  6. Alok Tiwari
    Member
    Posted 4 years ago #

    Its Okey
    Check Your Theme / Plugins

  7. 500 SHOULD be fine. I have a pretty busy site (yes, traffic DOES matter) and I use 250 on an average day (with spikes to 350-400).

    Optimization and caching can help. PHP setups can also be problematic. SuPHP sometimes doesn't share memory well.

    I would start by dumping any plugin you don't need, and then actually ADDING in minimization and/or a good caching plugin (W3TC or WP Super Cache)

    Alok, please don't sign your posts. It's against the guidelines.

  8. browndog82
    Member
    Posted 4 years ago #

    Thanks, Ipstenu.

    The averages for the sites are pretty low, but it looks like they do definitely spike a good bit -- making them hit that 500 threshold and not load properly.

    I will try the caching plugin and see what happens. Thanks so much!

  9. Alok Tiwari
    Member
    Posted 4 years ago #

    W3TC Or WSC with Minify works
    If You had not invoked them invoke now.

    The simplest way for you to use http://www.rackspace.com or any Good Scalable Hosting.Only If you face problems Even after Those tweaks.

  10. Alok Tiwari
    Member
    Posted 4 years ago #

    Make Sure to Optimize your DB too.

  11. browndog82
    Member
    Posted 4 years ago #

    Well I disabled all plugins and added WP Super Cache to a test site, but still won't load correctly :(

    Theme is Headway 101

  12. Alok Tiwari
    Member
    Posted 4 years ago #

    See Until You Share the Url
    Its Hard to anyone to help you..

  13. mralokkp - Please stop signing your posts. I've edited your comments to remove them, but if you keep it up, I'll flag you as a bozo.

    browndog82 - You'll need to work with your host to sort out where and what is causing the memory usage. The error logs should tell you what and where. From what you posted, I would say it's the theme, which means it's the theme's functions. So try Twenty Ten.

  14. Alok Tiwari
    Member
    Posted 4 years ago #

    Ipstenu
    I am sorry That is just a practice.What's Bad in that?
    Well! Who are you to flag me as bozo?
    I am just trying to help that guy.

  15. browndog82
    Member
    Posted 4 years ago #

    Thanks Ipstenu -- I just wish my host were being more helpful.

    I am going to test Twenty Ten.

  16. mralokkp - bozo flagging means that your posts are all moderated. Signatures are not permitted on these forums. Oh and saying I'm absuing you in another thread is a bit playing the martyr :) You're doing FINE, just re-read the forum welcome.

    browndog82 - That does suck, but at least you seem to have access to the error log! How many sites are you running, and is this on shared hosting or a VPS? Also are they separate sites or a MultiSite?

  17. browndog82
    Member
    Posted 4 years ago #

    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 75.xxx.xx.xxx] (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/imq/public_html/index.php, referer: http://www.examplesite.com/

    [Thu Apr 28 15:00:36 2011] [error] [client 75.xxx.xx.xxx] (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/imq/public_html/index.php, referer: http://www.examplesite.com/wp-content/themes/headway-101/style.css

    [Thu Apr 28 15:00:32 2011] [error] [client 75.xxx.xx.xxx] (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: http://www.examplesite.com/

    [Thu Apr 28 15:00:27 2011] [error] [client 75.xxx.xx.xxx] (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: http://www.examplesite.com/wp-content/themes/headway-101/style.css

    See anything that jumps out at you?

  18. 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.

  19. browndog82
    Member
    Posted 4 years ago #

    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.

  20. browndog82
    Member
    Posted 4 years ago #

    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!!

  21. 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.

  22. browndog82
    Member
    Posted 4 years ago #

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

  23. browndog82
    Member
    Posted 4 years ago #

    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.

  24. 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.

  25. browndog82
    Member
    Posted 4 years ago #

    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.

  26. browndog82
    Member
    Posted 4 years ago #

    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!

    Thanks!

  27. bcgear
    Member
    Posted 4 years ago #

    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 support@hostgator.com 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.

  28. bcgear
    Member
    Posted 4 years ago #

    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

  29. browndog82
    Member
    Posted 4 years ago #

    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:

    http://perishablepress.com/wordpress-robots-rules/

    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.

  30. bcgear
    Member
    Posted 4 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.