One (Wordpress) site goes down, others still up
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 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.)
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…?
@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.