HyperDB causing frequent MySQL connection errors
-
Please read fully. The fifth paragraph indicates why I’m posting in this forum.
I have a MySQL replication group with a single master and a single slave. I have a farm of three web servers running WordPress and each server is configured with HyperDB to read/write to the MySQL master first and then read from the slave second if the master should be unavailable. This configuration has been running very well for me for over a year.
Recently (I think it corresponded with my upgrade from WP 3.4.2 to 3.5 or from 3.5 to 3.5.1), I’ve been seeing database connection errors between WP and MySQL. I was running MySQL 5.5.20 and the symptom I was seeing was that servers in the web farm would become blocked from further connections to MySQL because they exceeded the
max_connect_errors
limit. That parameter has been set to the default of 10 since the cluster was originally configured.To be clear, the WordPress on each of the web servers functions normally, until this limit is reached. Then it can’t find the database and redirects to the Install WordPress page. It seems like each page hit is causing at lease one connection error to be recorded. As a short-term fix, I had to increase the
max_connect_errors
variable to 1000 and regularly runflush hosts
to keep MySQL from refusing connections.I went ahead and upgraded MySQL to 5.6.12 last weekend so I could get more insight into what was happening with the new
performance_schema.host_cache
table. While troubleshooting with this guide from MySQL, I decided to temporarily turn off HyperDB on one of the servers in the farm, and the number of connection errors from that server immediately stopped incrementing.Incidentally, it’s the
Aborted_connects
status variable that’s going crazy, and it’s thehost_cache.count_handshake_errors
field that’s growing for each server in the web farm. No warnings are being logged to the error_log regarding these aborted connections (and yes, I have log-warnings turned on).Since I can’t find any other references to this exact problem after much searching, I’m leaning toward it being a problem with my configuration of HyperDB, rather than a bug in the code that was exposed by a WordPress update. However, I’m stumped on where to go next. Has anyone else seen anything similar? Are there any good ideas out there on how to find my problem?
Thanks,
Tim
- The topic ‘HyperDB causing frequent MySQL connection errors’ is closed to new replies.