• Resolved mikesouthern55

    (@mikesouthern55)


    When www.ads-software.com blame the host, and the hosts blame wordpress; that doesn’t help.

    I have the error frequently, on multiple sites and with multiple hosts: Fatcow, Bluehost, Godaddy. Some use a local DB server, some use a remote DB server. A variety of host names are in effect.

    The only consistent factor is that the data in my wp-configs NEVER changes. Never. Not by me, not by anybody.

    If it’s a server issue, obviously the answer does not lie here. It is surprising that so many servers have so many issues. But I have run MySql servers for years and outside of WordPress, and outside of the DB server actually being down, I’ve not seen this error. Yet at the time the error is received the database is not down. Never. I can administer the DB, back it up, hit it through a non-WP script, at the same time as receiving the wordpress error message.

    The only common factor is wordpress itself, and I’d say that with so many thousands of people experiencing the same problem all over the place, isn’t this a big problem?

    Questions:
    * Is there a cache in effect when wordpress accesses wp-config? i.e. are the connection config data cached and if so could that cache fail?

    * There are many third party caches available. Do any of these impact the connection process?

    * Is database size an issue? Does the problem increase with size?

Viewing 15 replies - 16 through 30 (of 32 total)
  • Thread Starter mikesouthern55

    (@mikesouthern55)

    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.

    Had the same issue. I think it’s an exploit going around: https://www.webhostingtalk.com/showthread.php?t=1255387

    For now blocking access wp-login.php will fix the overloaded requests but you won’t be able to login to the site.

    Thread Starter mikesouthern55

    (@mikesouthern55)

    @gman243 I was about to think that I knew better but I stopped myself.

    I’ve had the error for nearly a year, off and on, same as many other people, but that doesn’t mean it’s not new.

    After some comms with the Bluehost I rechecked a bunch of different logs over the past few days and what I found that Bluehost had applied some severe CPU throttling since about Thursday night. They also showed me a repeating error in the PHP logs – “invalid character at line x position y”. I have no idea what this is. Bad character in an RSS feed? Separate problem.

    So what looks to have happened is that the site was subject to a lot of traffic – well beyond the normal 300-600 hits a day I normally get. Enough traffic to consume resources and force the CPU throttle.

    It also appears that it is during this time that WordPress has difficulty connecting; not because the database is down, but possibly because it’s fighting a lot of other resources to get a connection. The database is still accessible outside of WordPress.

    So I’m still watching. CPU throttling is off and has been for 15 hours, and no DB error is being received.

    I should install some other CMS such as Joomla to see if that too has the same connection problem when resources are under a heavy load.

    It may well be related to massive global brute force attacks on servers – lots of hosting companies have been hit hard the past few days:

    https://www.ads-software.com/support/topic/brute-force-attacks-and-wordpress?replies=1

    Thread Starter mikesouthern55

    (@mikesouthern55)

    Yeah I was just reading that.

    It seems a somewhat related topic; for a Mac-based WP home blogger what are the offline editors of choice? I’ve used MarsEdit. If the target is wp-login then does disabling front-end login, and uploading through the back provide a better way?

    I don’t want to be a bad messenger but XML-RPC enabled by default in WordPress 3.5.X
    On the other hand, there is a simply technique to find out admin real username.

    See, what I mean? Remote publishing invites a hacker to get through.

    I hope I am mistaken.

    Anyone could prove me wrong? Are there limits for wrong remote publishing login attempts? I would be glad to hear there is some cut off switch, otherwise, the doomsday is around the corner.

    Are there limits for wrong remote publishing login attempts? I would be glad to hear there is some cut off switch, otherwise, the doomsday is around the corner.

    You have to install a plugin or modify WP to put limits on failed login attempts.

    Okay guys.

    I thought that you overlooked my question because I meant reaching the site using offline blog editors, not the generic wp-login.php page.

    Turns out
    https://www.ads-software.com/extend/plugins/limit-login-attempts/
    blocks failed login attempts for XML-RPC protocol too.

    I should’ve tested it before making this noise. ??

    Thanks!

    Thread Starter mikesouthern55

    (@mikesouthern55)

    So, in short, remote publishing doesn’t help because a) it may be another way in for an intruder and b) it won’t alleviate the attempts to gain access elsewhere.

    How about synching wordpress sites so that one effectively becomes the backend editorial centre – possibly complete on a home server – while a synched unit become the published front end, on a host but with no access at all. Synching performed at the DB level. The current problem with swamping is that The Mrs – who edits the site – can’t do her work when the site is slow or unavailable. That makes life a pain. Visitors to the site are less likely to suffer from the same impact so if I can find a way to keep the production smooth while releasing expediently to the front life will be good.

    I guess I’ll search for the elsewhere in the forum. Point me links if it’s a conversation you know about.

    For what it’s worth .. I’m trying to develop my website locally and I’m getting the same problem. Most of these posts are way over my head but I do have an operational copy of the site running on 1 machine and the other “corrupted” version that won’t connect to the database. I running instant wordpress. I’m using a difference tool to examine the files between the operational and defunct versions. My problem is repeated and intermittent – I have compared WP-CONFIG.php ; FUNCTIONS.PHP ; and WP-CRON.php – the are identical. Is there another comparison that I may make that might help. It’s starting to look like WordPress is useless and I wasted a lot of time. Thanks for everyone’s input

    @jfk229 – if you need help, please start your own thread – your situation and issue is not the same as this thread.

    https://codex.www.ads-software.com/Forum_Welcome#Where_To_Post

    Hi there,

    Just to add to this conversation…

    We host many wordpress websites, some on shared hosting and some on a dedicated server. Regardless of server, we still see the “Error establishing a database connection” message intermittently.

    This can be working locally on a site where the database is online or when working online where the database is local.

    It’s a very bizarre issue :s

    @br0wnie91,
    Please start your own thread – your problem is not the same as the issues in this thread.
    https://codex.www.ads-software.com/Forum_Welcome#Where_To_Post

    Krishna, is there a place to complain about moderators on this forum?

Viewing 15 replies - 16 through 30 (of 32 total)
  • The topic ‘Error establishing a database connection’ is closed to new replies.