One (Wordpress) site goes down, others still up

Can anyone explain why this is happening and how to make it stop? I have a 768 with a few different sites running on it - three Wordpress, one Drupal. By far the highest-traffic site is a blog about fantasy football (what the heck, here's a link - http://ffgeekblog.com).

As you might imagine, this is a busy time for that blog. Lately it's been going down a few times a week (usually following a relatively small spike in CPU), but oddly enough the other sites on my Linode all continue to work just fine. Every time it happens, I restart Apache and the site's back up in a few seconds.

How is this happening? The server isn't OOMing; it was doing that a month or two ago but I tweaked the heck out of my apache2.conf file and now that never happens. Any ideas? Thanks in advance.

5 Replies

What is the symptom when the site "goes down"? Do you get an immediate error when you try to access the site, or do you get a timeout after a few seconds?

What exactly does your setup look like? prefork & mod_php? fastcgi? What values do you have for MaxClients and KeepAlive? Any screenshots of "top" when the site goes down?

Anything in the Apache error log? MySQL error log? If the problem only affects one site, the database might be the culprit. Check the tables on MySQL.

You might have to disable the static file option in WP Super Cache and clear the cache in order for the real issues to show up on log files. (I know you're using it because there's a telltale signature at the end of the HTML.)

It's an immediate 500 error. I'm using prefork and mod_php. Error logs are (frustratingly) empty although logging is turned on.

Notable config info:

KeepAliveTimeout 4

 <ifmodule mpm_prefork_module="">StartServers       2
MinSpareServers   2
MaxSpareServers   9
MaxClients       35
MaxRequestsPerChild  4000</ifmodule> 

Your comment on WP Super Cache just made me wonder if that module itself could have something to do with this…?

PHP sometimes has its own error log depending on the setup. Might want to see if that's the reason you don't see any errors in the Apache error log.

@moosetoga:

It's an immediate 500 error. I'm using prefork and mod_php. Error logs are (frustratingly) empty although logging is turned on.
500 with a blank screen is definitely a PHP error. All we need is the error message.

If this is a standard LAMP stack on Debian or Ubuntu, see /etc/php5/apache2/php.ini and make sure that "logerrors" is "on". This will make PHP dump all of its errors to Apache's error log. Restart Apache to apply the new settings. If this doesn't work, you can also specify a different log file using the "errorlog" setting. If you do this, make sure that the log file is writable by the www-data user.

Another option is to enable "display_errors" temporarily. This will simply dump error messages on the screen whenever an error occurs. This is often considered insecure because it might expose the internal workings of your server. But every shared host has this setting turned on, and every self-respecting WordPress hacker already knows the internal workings of a WordPress site, so I'd say the risk is relatively low.

@moosetoga:

Your comment on WP Super Cache just made me wonder if that module itself could have something to do with this…?
You could try disabling Super Cache for a day or two, but that will have a massive impact on performance. Serving a static file is hundreds of times faster than serving a fresh WordPress page.

Thanks for the advice. logerrors was on but displayerrors wasn't so I turned that on. Now I wait for it to happen again so I can hopefully get another clue…

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct