WordPress.org

Ready to get started?Download WordPress

Forums

Dreamhost Memory Usage on VPS (20 posts)

  1. apticknor
    Member
    Posted 1 year ago #

    Hello,

    URL: witanddelight.com

    I'm currently running WordPress 3.5.1 for the last 2 months on dreamhost using VPS. When the site launched, every few days it would run out of memory and need to be rebooted via the control panel.

    I investigated the code for memory leaks and memory usage carefully and implemented caching. This made the site run for a week at a time before needing a reboot. So it helped but didn't solve the issue.

    I cannot continue to reboot the server weekly to keep it running. Anyone have any suggestions on how to track down what's causing this?

    Here's some data that may help.

    Currently allocated memory: 600 MB
    WordPress version: 3.5.1
    Plugins: Askimet - Advanced Custom Fields - Hierarchical Link Categories - WordPress Importer - WP Memory Usage - WP Super Cache

    Analytics From Jan 1 2013 - Feb 20 2013
    99,130 Visits
    52,836 Unique Visitors
    212,135 Page Views

    Thanks in advance for anyone with insight to be provided.

  2. Andrew Bartel
    Member
    Posted 1 year ago #

    I honestly wouldn't want to run a site that gets ~60k visits a month on less than 2g on memory.

    As an example, I manage a site that's about double that traffic wise and we have four and we still nearly peg it sometimes.

  3. apticknor
    Member
    Posted 1 year ago #

    I was just checking the error logs and found this repeatedly. Maybe this is related?

    [Wed Feb 20 01:59:56 2013] [error] [client 54.234.71.89] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

  4. Andrew Bartel
    Member
    Posted 1 year ago #

    That would do it. It could be a lot of things though. It could be an .htaccess redirect, could be an apache redirect, could be some application level redirects, etc.

  5. Ipstenu-DH
    DreamHost Rep
    Posted 1 year ago #

    I have to second Andrew there. 600megs is cutting it close. You've got 212 pageviews in a month an a half (so we'll say 180k a month?) That's a lot. I'd be running at least a gig on it, since your load is nice and low. If load started spiking with a lot of posts, you'd want to bump that to 2.

    By the way, WP Super Cache doesn't seem to be working. It's not showing up in your page source, so that certainly isn't helping.

    I'd normally say to use W3 Total Cache on a VPS, but since Memory's already an issue, and W3TC uses more, you should try customizing with Pagespeed first. You can turn it on in your panel.

  6. apticknor
    Member
    Posted 1 year ago #

    Yup, Super Cache was off as I was doing some testing. It's back on now.

    I agree the RAM should probably be increased but I'm also working for a customer with a set budget.

    We tried this at first - Memory was bumped up to 4GB and I watched memory usage climb slowly over 2 weeks to or so to using 4GB and then requiring a reboot. That's what lead me to suspect memory leak.

    For the most part, with Super Cache on it's happening less but it's still requiring too frequent of reboots.

    I'm currently trying to get the apache error to trigger. But even when combining the access.log details with the error.log I can't find a URL to hit that will trigger the apache error. There is also no referrer for the apache error. If I could find a URL to trigger the error, I could adjust the .htaccess accordingly and see if anything in there is causing it.

  7. Ipstenu-DH
    DreamHost Rep
    Posted 1 year ago #

    There are a couple small things you can do to save memory on the VPS.

    Turn off Jabber and FTP. You'll have to use SFTP instead, but that's safer anyway.

    You can also switch to PHP 5.3 FastCGI (you're just on CGI now), which uses less memory in our config, and turn on PageSpeed, which will let you compress CSS and JS, without making WP do the work. PageSpeed won't help memory much, but it will keep the site running faster.

    Also you can remove the 'Remove the www' bit from your .htaccess and have that forced in Panel as well.

    I noticed you have WP in a subfolder, but INSTEAD of running it out of it's own directory via index.php, you're using a more complicated .htaccess rule, which may be what's going on. Is there a reason you didn't want to use the normal way about that?

  8. apticknor
    Member
    Posted 1 year ago #

    I switched over to PHP 5.3 FastCGI, turned on PageSpeed and removed my .htaccess rule for WWW removal (and set it up via the dreamhost panel). I set Jabber & ftp to inactive on the configure server page.

    I prefer to run wordpress in a subfolder with the core and content folders clearly separated so it's easier to update and more importantly gives me the ability to keep core in an external so I can drop in a boilerplate of sorts into content with a nice skeleton theme to start from. I haven't had issues with this on other wordpress sites I've done, even ones currently residing on dreamhost.

    I did however look closely at my htaccess rules and found a duplicate rule. One in the site root and one in the subfolder .htaccess. The one in core had been added by something in wordpress to handle permalinks. Now that I've removed one of the duplicate rules, the LimitInternalRecursion error hasn't showed up in my log in the last 12 hours (was previously happy much more frequently).

    I've made a lot of changes so I'm going to monitor for a few days and see what comes of it. Thanks for your help!

  9. Ipstenu-DH
    DreamHost Rep
    Posted 1 year ago #

    I prefer to run wordpress in a subfolder with the core and content folders clearly separated so it's easier to update and more importantly gives me the ability to keep core in an external so I can drop in a boilerplate of sorts into content with a nice skeleton theme to start from.

    Sure but the way you're doing it is... odd :)

    http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Using_a_pre-existing_subdirectory_install

    That's what made me go 'Huh?' I almost always have WP in it's own folder too, cause I'm a neat freak ;) but also because I'm usually running more than 'just' WordPress, so I have /wordpress /mediawiki and /zenphoto all in a row.

  10. apticknor
    Member
    Posted 1 year ago #

    Here's an update on memory usage -> http://witanddelight.com/stats.png

    You can see where I switched to FastCGI... The memory usage appears much more volatile and up and down. Prior to that it would slowly ramp up over time but the graph is more all over the place now this morning.

    I can't remember where but I previously read about not using FastiCGI due to this. Perhaps I'm incorrect. When I read this I stopped using FastCGI and things level out.

  11. Ipstenu-DH
    DreamHost Rep
    Posted 1 year ago #

    Interesting... I've not seen that happen before, but every site is different. I agree, I'd switch back to 5.3.x CGI (or 5.2 if you want to turn on xcache without installing it manually).

  12. apticknor
    Member
    Posted 1 year ago #

    I switched it back to regular CGI and not FastCGI. Things appear to be stabilizing again. I'll need at least a few hours to get some accurate data.

  13. Ipstenu-DH
    DreamHost Rep
    Posted 1 year ago #

    I wonder if it's something else you're running. I'll poke around and see what's up with that on another server :)

  14. apticknor
    Member
    Posted 1 year ago #

    Thanks for taking a look!

  15. apticknor
    Member
    Posted 1 year ago #

    Did you find anything out? I've been watching the last couple of days. It seems that usually around 4a-5a a bunch of cached memory clears out. What causes that? Is there anyway to make that happen more frequently?

  16. Ipstenu-DH
    DreamHost Rep
    Posted 1 year ago #

    I haven't had a chance to dig into it as much as I want (Friday ran away with me, and I was prepping for a WordPress presentation this coming weekend).

    The cache being flushed at night is what we want. There isn't a way to hook into that though without rebooting, which we rarely want.

    http://www.7is7.com/software/dreamhost/psmanager.html is a script one of our users wrote to manage a VPS, but it too has to reboot you :/

  17. NoProbRob911
    Member
    Posted 1 year ago #

    @Mika E

    You said:

    I have to second Andrew there. 600megs is cutting it close. You've got 212 pageviews in a month an a half (so we'll say 180k a month?) That's a lot. I'd be running at least a gig on it, since your load is nice and low. If load started spiking with a lot of posts, you'd want to bump that to 2.

    I am considering switching to DreamHost since my current host is having "latency issues" slowing several WordPress-based sites from under a second or two page load time to as much as 20 seconds, with no ETA for a resolution to this issue. (This has been an intermittent but recurring problem with that other hosting company for many months now.) But after reading your comment, above, I am having some reservations.

    I contacted DreamHost sales via email to ask for a recommendation on hosting plans, and the rep suggested shared hosting. For me, that would be about a dozen separate plans (for that many domains, one domain per shared plan). Combined, these domains probably have less traffic currently than the one site mentioned above. (Depending on how you are defining the traffic, that is. Do you consider all those Far East POSTs to wp-login with user name 'admin' and various passwords such as '12345' or 'password' to be a page view?)

    Would I be better to opt for a VPS plan and host all my domains on a single VPS? And if so, with how much RAM? (I can't find anything on the DreamHost website which really explains how to determine how much RAM an installation needs. I realize, of course, that that is dependent on what you're running on the site, but some examples or something would be helpful.)

    Or should I jump straight to dedicated server (which to be honest is outside my budget range for these non-profitable sites)?

    Any clarification to help determine what's right for me would be much appreciated. Thanks!

  18. Ipstenu-DH
    DreamHost Rep
    Posted 1 year ago #

    Shared hosting caps out around 500megs I think.

    That said, the way we do multiple domains is a little different from other hosts. If you have one account with us, on shared hosting, you can have multiple users and multiple separate domains, all on one hosting. You would end up with all your domains on one server, and if you're well under the traffic of apticknor, then you'll probably be okay on shared.

    The cool thing, IMO, is that you can start on shared. If you don't like it, or if you need more power, you can seamlessly move to VPS. But if you're under 100k pageviews a month for your sites combined, you MAY need VPS, and you may not. A lot of this matters to how you optimize your site, how you cache, and how interactive the site it. If you're around 50k views, you should be right as rain.

    I would put all three under the same username on one shared hosting account. Make 'em all PHP 5.3 (or 5.4), and you can use PageSpeed if you want for extra caching powers.

    Oh and this?

    Do you consider all those Far East POSTs to wp-login with user name 'admin' and various passwords such as '12345' or 'password' to be a page view?

    Usually not :) They do impact your memory and CPU though. Most pageview records ignore wp-admin.

  19. NoProbRob911
    Member
    Posted 1 year ago #

    @Mika E

    Thanks for the info. It's much appreciated. One thing, though. You said:

    I would put all three under the same username on one shared hosting account.

    But my previous post said I have a dozen (as in 12) sites, not three. Of those, three are "mission-critical," four are "important" to me, and the rest are "just for fun." But they total probably less than 20k page hits per month, combined. (One is a rural church, another is a small town auto service garage, etc.) They all use WordPress as the underlying "engine" to make it easier for the users, but they have very little updating going on. A few "blog" posts a month on each maybe.

    So what do you suggest? Could a single shared plan handle this many separate WP installations (with all the associated memory overhead)? Or maybe three shared plans with one "critical," one "important" and one "fun" site on each (more or less)? Or would it be better to jump to VPS for all of them (or maybe 2 separate VPSes with 6 on each) and, if so, at what memory level? Again, we're not talking a lot of traffic; we're talking a lot of CPU/RAM for the multiple installs.

    One more thing: When DreamHost says "100% uptime guaranteed," how does DreamHost define "uptime?" My current GoshDarn™ hosting service seems to define 20 second page load times as being "up," even though a week ago the same page loaded in less than 1 second. (With no changes to the site.)

    Sorry, I realize this is getting somewhat tangential to the original forum topic, but hopefully not too bad ...

    Thanks again.

  20. Ipstenu-DH
    DreamHost Rep
    Posted 1 year ago #

    Sorry, I misread. You can still put a dozen, or a hundred, under one shared account the way our system works, but the issue is less the number of sites and more the traffic those sites get. You can have ONE site that's too massive for a shared host. Without having the specs of your traffic, CPU and memory usage, the best I can say is "It depends on how much you got."

    The numbers are cumulative. If ALL your sites add up to a large amount, then you have your answer :) If they're all pretty small, pretty quiet, and pretty low key, you'll probably be okay.

    One more thing: When DreamHost says "100% uptime guaranteed," how does DreamHost define "uptime?" My current GoshDarn™ hosting service seems to define 20 second page load times as being "up," even though a week ago the same page loaded in less than 1 second. (With no changes to the site.)

    Realistically? Uptime is uptime. If your site is slow, it's still up. Hosts aren't talking about server speed when we say uptime, we mean your server is up, available, getting power, etc etc.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags