WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] DreamHost 404 when working in admin (27 posts)

  1. kgagne
    Member
    Posted 3 years ago #

    I have a VPS with DreamHost. In the last few months, I've been getting more and more 404s while using WordPress 3.0.4's administrative interface, such as publishing posts, activating plugins, or approving comments. The only recurring error I see in my error.log file is "Premature end of script headers". Even the frontend of the site can take 15+ seconds to load, if at all, as indicated by Pingdom Tools. Though I've set my VPS's memory limit to 374 MB, my admin panel rarely shows usage above 247.

    I've read several threads on similar issues and have followed some suggestions, such as pruning my plugins and adding this line to my wp-config.php file:

    define('WP_MEMORY_LIMIT', '90M');

    and disabling this line that's added by DreamHost's one-click installer:

    $base = DB_NAME;

    I've not installed any caching plugins, as even though I currently run 16 WordPress sites, none of them receives more than double digits of pageviews per day. (Only half accept comments; most have revisions disabled.) I had DreamHost's Google Pagespeed option enabled for awhile, but it seemed to make things a bit worse, so I disabled it.

    With all my plugins enabled, my site makes about 22 queries to load the homepage. The TPC plugin pointed out one instance of high memory usage that involved 38 database queries -- presumably while I was accessing the admin panel.

    Here are some other statistics reported by the TPC plugin when loading a page:

    TPC! Memory Usage (http://webjawns.com)
    Memory Usage: 23413816
    Memory Peak Usage: 23749872
    WP Memory Limit: 90M
    PHP Memory Limit: 90M
    Checkpoints: 7

    From the admin dashboard:

    Usage Sample: 30.62MB (12%)
    Peak Usage: 30.87MB (12%)
    All-Time: 22.33MB on 2/1/11 @ 11:28 pm (wp_head)
    Load Averages: 0.23 0.28 0.28
    WP Memory Limit: 90M
    PHP Memory Limit: 90M

    I've recently optimized my databases via phpMyAdmin. I also ran a free Load Impact test.

    Despite these efforts and diagnoses, my problems persist. Do any of these numbers look unusual? Any suggestions of what I could try that I haven't already?

  2. eatlocal
    Member
    Posted 3 years ago #

    I definitely think this is a Dreamhost issue that they are not owning up to. I have their shared hosting and have the same issues, yet they suggested I move to a VPS account to resolve the issues. Obviously that is a lie if you're on a VPS and having the same problems.

    I have another WordPress site with a different web host, and a much lesser hosting packing, and I *never* encounter any of these 404 issues as I do with Dreamhost. Actually I've never encountered any of the problems I have had with Dreamhost! (Time to switch I guess.) And this other site is at over 600 pages, running a business directory, and getting far more traffic than all my sites on Dreamhost combined.

    Sorry that I'm not answering your questions, other than pointing out that I feel that this is a Dreamhost issue which they refuse to resolve.

  3. kgagne
    Member
    Posted 3 years ago #

    Thanks for the reply, eatlocal -- commiseration is always appreciated. :-)

    I had a friend with these issues on a shared server. They were resolved when he moved to a VPS.

    Even though each one of my individual sites may be within its memory limits, it's possible that I'm running so many WordPress sites that collectively, they're exceeding their bounds. Maybe I should try increasing my maximum RAM even further, an option available only via the VPS plan. It's a potentially expensive solution, though.

    -Ken

  4. kgagne
    Member
    Posted 3 years ago #

    Adding additional memory to my site does seem to have worked. I guess the memory usage charts available in the admin panel weren't very accurate.

  5. giapet
    Member
    Posted 3 years ago #

    I'm having this same problem, also with DreamHost, even after doing the VPS trial. I'm trying your wp-config fix to see if it makes a difference, but I wanted to chime in that VPS will not necessarily fix things.

  6. kgagne
    Member
    Posted 3 years ago #

    Good luck, giapet! Let us know what happens.

    FYI, as an amendment to my original post, a friend and fellow DreamHoster recommended I try commenting out all four of these lines from wp-config.php:

    $server = DB_HOST;
    $loginsql = DB_USER;
    $passsql = DB_PASSWORD;
    $base = DB_NAME;

    I haven't tried it yet, as those lines don't appear in all my sites, so I'm not sure how much a difference it will make.

  7. giapet
    Member
    Posted 3 years ago #

    I'm no expert, but wouldn't commenting out all of those lines cut WordPress off from the database it needs to run? >_>

  8. kgagne
    Member
    Posted 3 years ago #

    My WordPress sites that lack those lines are running fine on DreamHost. I too am no expert, but I think they have something to do with WordPress 3.0+'s multisite network features, which I don't use.

  9. giapet
    Member
    Posted 3 years ago #

    Well, here's a plus: turns out I hadn't actually set up the domains *on* the VPS yet (although now I'm disconcerted that my VPS records show some usage despite having no domains).

    Will get back to you once I've set it up properly.

  10. kgagne
    Member
    Posted 3 years ago #

    Ah. That can make a difference. :-) Good luck with the transition! Let us know what happens.

  11. giapet
    Member
    Posted 3 years ago #

    Well, so far it's been some 12+ hours and I haven't gotten an e-mail confirming that my domains have been moved over to the VPS, just a couple of notifications about WordPress updates that I'm guessing are related (but might not be?).

    I'm pretty confident I'll be spending this weekend moving away from DreamHost...just gotta decide where to -_-

  12. kgagne
    Member
    Posted 3 years ago #

    Sorry to hear that, giapet. Have you emailed their customer service? I usually get pretty fast responses from DH -- in fact, between their email replies, Twitter account, and blog, I'd say status updates are one of this hosting company's strengths.

  13. giapet
    Member
    Posted 3 years ago #

    I've been talking to them throughout this whole process of trying to track down these 404s...spent hours and hours tweaking everything to try and lessen my memory usage to get those procwatch kills to stop. Sigh!

  14. kgagne
    Member
    Posted 3 years ago #

    How many WP sites are running? What is your memory limit set to?

    A friend of mine found his high memory usage was caused by having redundant analytics plugins installed. As soon as he disabled Ultimate Google Analytics, leaving only Google Analyticator, things got much better.

  15. giapet
    Member
    Posted 3 years ago #

    DreamHost has been a bit reticent at answering what my memory limit actually is; I currently have three installs, one of which is semi-plugin heavy, and one of which is fairly heavy on plugins. None are redundant though...as part of all that tweaking I made sure to get rid of any plugins I'm not using, and I don't have any google analytics plugins.

    Each install has a limit of 90mb of RAM, though, and the sites only range from like 25-35mb according to the memory usage plugin.

  16. kgagne
    Member
    Posted 3 years ago #

    If you're on a DreamHost VPS, you should be able to set your own memory limit.

    https://panel.dreamhost.com/index.cgi?tree=vserver.usage&

  17. giapet
    Member
    Posted 3 years ago #

    Yeah, but I'm not even sure my stuff has all been moved over to the VPS-- I show almost no usage, even though it's been 12 hours and it all should have moved by now.

    I guess I'll go poke DH and see if they can tell me that much, at least.

  18. Rhand
    Member
    Posted 3 years ago #

    Dealing with a similar DreamHost issue with a plugin heavy site and I am writing about it here: http://wordpress.org/support/topic/backend-errors-premature-end-of-script-headers?replies=8#post-2007448 . I might have to ask the client to upgrade to a VPS as well... Never had this procwatch memory kill easy with other webhosters before.

  19. westcoastcontent
    Member
    Posted 3 years ago #

    Having the same issue with tasks I typically do that does not happen on my other host.

    I have a number of sites that are based on different topics but have the same structure and plugins. I started on Bluehost and recently decided to launch my newest on on DreamHost to compair.

    Tasks I usually run such as add a new catecory or tag and then apply it to existing posts usually results in this listed 500 error, this NEVER happens with the same site setup different content on bluehost.

    I'm still in trial, but will not stay if this cannot be resolved.

    New site I am building on dreamhost
    http://onlinecomputersupportandrepair.com/

    Existing site on bluehost
    http://freeappliancerepairmanonline.com/

  20. Gwyneth Llewelyn
    Member
    Posted 3 years ago #

    Sorry to bump this thread. While this is a DreamHost-specific issue, DreamHost are listed as close partners of Automattic, so I guess many WP sites run on them.

    Like many WP users, I've done a lot of tests, and the 404/500 errors pop up no matter what. But finally I've traced it down, thanks to this useful article: http://boomshadow.net/tech/php-handlers/

    Since I have all my sites on PHP FastCGI (to improve performance and be less 'demanding' on DH's servers), I didn't realise that it consumes far more RAM than "normal" CGI. Also, PHP 5.3 is far better at managing RAM than PHP 5.2. Nice and cool modules like Web Security and Google's Page Speed also consume RAM in exchange for better performance and more security. With all that, WP processes tend to go over DH's RAM limit.

    Well, so right now I'm using PHP 5.3 with "normal" CGI, turned off Web Security and Page Speed, and use W3 Total Cache and Cloudflare as an external caching/reverse proxy system instead. W3 Total Cache will neatly "accelerate" the pages by compressing them, using Minify on CSS + JS, and so forth — and also make sure they all get statically stored, both on disk and on the user's browser. To deal with bandwidth and speed, Cloudflare does the trick, by caching about 40-60% of all requests — and additionally running a security check on the pages as well (which might be better than DH's own system). Since Cloudflare is externally hosted, well, they can consume as much RAM they want, it won't interfere with DreamHost and still give excellent performance. :-)

  21. Rhand
    Member
    Posted 3 years ago #

    @ Gwyneth Llewelyn Thanks a lot for all the information! Looking into Cloudflare and into FastCGI versus CGI and performance. W3 Total Cache is a plugin I have been using a lot already and it has helped out a lot. But now that I have more tips I can perhaps avoid more of these cutoffs. Thanks again!

  22. kgagne
    Member
    Posted 3 years ago #

    Gwyneth,

    Bump away! As far as I'm concerned, this topic is still relevant. Lately, I've gone from 404s to flat-out "could not connect to server" messages. I have to reboot my VPS and increase the RAM, which in the last two weeks has gone from 750 MB to 1250 MB — a significant price increase for someone like me. Here's DH's response to my experience:

    I've looked into the cause, and have found that your VPS has been spiking above it's set memory usage. When a VPS spikes above it's set memory limits a couple of things happen on the physical machine on which it runs. First an application called "OOM Killer" is invoked. This application forcibly ends the process running on the VPS in order to return the guest's usage to a state which is within it's set limit. Now, previously after this happened the VPS would then be able to spawn that same thread, going right back over the memory limit, and it would be killed by OOM killer again. The main issue with this behavior, was that due to the number of spikes, OOM Killer itself would drive up the load on the physical machine, slowing it down, and causing issues on all customer's VPS. We've prevented this behavior by installing a helper application which runs after OOM Killer has terminated an errant process. This helper application, "Hurt Locker", temporarily freezes an offending VPS, which prevents it from spiking over the memory limits on a constant basis, and keeps the machine itself running well and other customers from being affected by an under-allocated VPS.

    As your VPS is in fact spiking over it's set memory limits, you will experience 500 errors, connection errors, and general site unavailability.

    Your VPS has been frozen by Hurt Locker 67 times according to the following log. This strongly indicates that your memory levels are not sufficient for the sites and/or traffic on your VPS

    Please understand that while you may not be hitting your disk space or bandwidth limits, these are actually entirely different things. Also, as the spikes typically occur and are then subsequently killed within milliseconds, they often don't register on the panel memory usage graphs at all(We will however be making the hurt locker logs available in the panel ASAP).

    I thought I'd switched all my sites to PHP 5.3 and disabled Google Pagespeed, but I see a few are still on 5.2. I had no idea that FastCGI, being "less demanding on DH's servers", could use more RAM, or that the web security module also consumed resources.

    I'll have to look into Cloudflare. I don't use a caching plugin as my 17 WordPress sites average only about 100 hits per day each, which doesn't seem like enough to warrant caching.

    How long have you been using the configuration you described?

    Thanks for the tips!

    -Ken

  23. kgagne
    Member
    Posted 2 years ago #

    Gwyneth,

    I moved all my sites from PHP 5.2 FastCGI to PHP 5.3 CGI. My memory usage immediately dropped from almost 1000 MB to 100 MB. What a difference!

    I did not disable extra web security, and I enabled CloudFlare on only one of my sites as a test. Neither seems nearly as significant as the PHP change.

    Thanks!

    -Ken

  24. jill
    Member
    Posted 2 years ago #

    Gwyneth, thank you so much!

    I really like DreamHost, and I didn't want to change, but that damn error was driving me crazy! I switched to PHP 5.3 CGI and haven't had a problem since.

    For the record, I left Web Security on and I don't use W3 Total Cache or Cloudflare.

  25. Rhand
    Member
    Posted 2 years ago #

    Just switched to PHP 5.3 Normal CGI. Seems to be an improvement to the site's loading speed. But still had an error:

    Fatal error: Allowed memory size of 94371840 bytes exhausted (tried to allocate 71 bytes) in /home/user/domain.com/wp-includes/cron.php on line 221

    using Scribe SEO. Memory limit is 128MB

    define('WP_MEMORY_LIMIT', '128M');

    Hmm..

  26. kgagne
    Member
    Posted 2 years ago #

    May want to ask the ScribeSEO guys for help on that.

    https://my.scribeseo.com/

  27. brandsteve
    Member
    Posted 2 years ago #

    The immediate results of switching from PHP 5.2 fastcgi to PHP 5.3 cgi in the dreamhost VPS memory usage graphs are stunning.

    Glad I found this thread. Got more benefit in just a few minutes than many back and forth messages with dreamhost support.

Topic Closed

This topic has been closed to new replies.

About this Topic