Thanks for all the conversation. I am on US time. Just got up.
The URL in question is https://www.commonamericanjournal.com but I’ve received it on other wp sites also.
When I receive the error message, sometimes it just displays “Error establishing a database connection” and sometimes it displays the full explanatory verbage.
I have sought the Host support (Bluehost) and they are unable to provide any insight. Their system logs are not available to me. Their last response was “I am sorry, I am unable to replicate your issue and do not see any errors on any of your pages, sorry. If you are still experiencing issues please clear your cache and cookies and try again. If that does not work, then try a different web browser or computer. If you are still having trouble after all that, please give us step by step instructions on how to replicate the problem.” I chose Bluehost because they are supposedly one of the top 2 recommended WP hosting sites for speed and reliability.
The site originated on a Godaddy platform in 2009. The space I rented hosted many domains. In 2011 I started to experience slowness so on GD advice I relocated to one of their Grid configurations. It helped a little but wasn’t great and performance really tanked in Sept/Oct of last year. I had started to received the Database Error message since the middle of 2012. Godaddy could not resolve that problem, and could only suggest caching to improve the performance. It didn’t work and I am convinced that they had problems they could not identify so I moved to Bluehost in Dec 2012. I’ve had the Database Error three times in that timeframe. I also ran a duplicate of the site on a Fatcow host during this time, so I could size them up for performance. They didn’t resolve the speed issue and also generated the Database message.
By “three times” I mean that there have been three instances at which for a period of 12 hours or so, the message appears, then it’s OK, then returns. It’s intermittent, then I can go for weeks without seeing it. I do have a lot of RSS feeds served using KB Advanced RSS Widget but when using various performance analysis plugins they haven’t shown to degrade performance particularly.
That statement seems to point to a server host error apart from the fact that while the WP installation is down, the database is very much connectable by two other distinct sources.
Finding commonality is a problem. For example if we could say that it only happens to databases over 20Mb and where WP Super Cache is installed life would be simpler.
>”If you’re convinced that this is somehow a WordPress issue, how would you explain the connection working sometimes and not other times when it’s exactly the same code that’s in use in every case?”
No I can’t, but I didn’t write WordPress. I could make assumptions but I’ve no basis for doing that. If a connection is made for every page load request then it seems that sometimes the connection data is unavailable. The database itself, apparently, is always available.
>If this is intermittent then it’s a hardware issue. It means that the connection cannot be made between Apache and MySQL at the exact time that the connection was requested.
That’s a sane statement, to be sure. Put it in the context of being generated on sites hosted at Godaddy (Ultimate), Fatcow and Bluehost. Really? All three hosting infrastructures have this problem? I ran an Apache/MySql/PHP/Perl application on my own server – in a space completely under my control – for 7 years, serving pages and PDFs to a 5,000+ user base hitting the site at around 1200 hits a day. I never even had a server crash let alone saw this error message. Unless the database actually is offline I’ve only ever seen it in a WordPress application.
>Saying that it must be WordPress because other things work when tried close to that time is not an arguement
Well, it maya not be right, but it is an argument especially when across platforms, configurations and timeframes the only constant is WordPress itself.
>Another thing to remember is that most servers have limits on the amount of active connections that can be created to MySQL and blocks any new connections from being made … milliseconds …
And as you say this gets closer more often on a shared host. All three platforms (four if you include the work server I mentioned) use the same value. Milliseconds difference in connect time; yes. But when I get the database error, while WP shows it intermittently during the “event cycle”, the database by other connections is still available. last night I had the two environments side by side: on the right, a browser which displayed a cannot connect message persistently over a 5 minute timeframe. On the left, a PHP script calling a server-side database access script to download blog headlines and ID numbers. While the WP site error persisted, the script access was fine. That’s an event duration of 300,000 milliseconds.
The database error does not seem to be size- or hit-related. I have a very small and clumsy personal site at mike-southern.com and it too periodically suffers from the same fault. It’s still on Godaddy. Only one person a week visits that, and that’s me ??
While it may eventually not be a WordPress problem I think WordPress have to own it. It is the only common factor amongst thousands(?) of instances of differing host, http server, size, usage, configuration, mysql version etc etc. I’m not impressed with the response of “go check your host logs”. By “own” it I mean WordPress user groups have to set up installations using the same commercially available environments and experience for them selves. It doesn’t happen everywhere; why not? Presumably wordpress.com and .org do not experience ut. Why not?
I think I answered the questions people asked. Thanks for your input.