Title: HyperDB causing frequent MySQL connection errors
Last modified: August 21, 2016

---

# HyperDB causing frequent MySQL connection errors

 *  [wp_timmiller](https://wordpress.org/support/users/wp_timmiller/)
 * (@wp_timmiller)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/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 run `flush 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](http://dev.mysql.com/doc/refman/5.6/en/communication-errors.html)
   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 the `host_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
 * [http://wordpress.org/extend/plugins/hyperdb/](http://wordpress.org/extend/plugins/hyperdb/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [marshalld](https://wordpress.org/support/users/marshalld/)
 * (@marshalld)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/hyperdb-causing-frequent-mysql-connection-errors/#post-3837610)
 * Hi Tim,
 * I found the same issue.
 * For me, it was cause by the way HyperDB checks for TCP responsiveness.
 * I disabled the check and it went away.
    //$wpdb->check_tcp_responsiveness = true;
   $wpdb->check_tcp_responsiveness = false;
 * For some reason, MySQL doesn’t like the TCP responsiveness chacks.
 * When you look at the stats in MySQL, you can see that the handshake errors go
   up every time HyperDB does a check.
 * mysql> select SUM_CONNECT_ERRORS, COUNT_HANDSHAKE_ERRORS from host_cache where
   host = ‘back-0’;
    +——————–+————————+ | SUM_CONNECT_ERRORS | COUNT_HANDSHAKE_ERRORS
   | +——————–+————————+ | 80 | 80 | +——————–+————————+ 1 row in set (0.00 sec)
 * Can this issue be escalated to get it resolved?
 *  [JordanThurston](https://wordpress.org/support/users/jordanthurston/)
 * (@jordanthurston)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/hyperdb-causing-frequent-mysql-connection-errors/#post-3837624)
 * This ^
 * I too am getting this error. Constantly.
    If we could get some feedback from 
   devs on specifics and possible solutions I would be most grateful!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘HyperDB causing frequent MySQL connection errors’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/hyperdb_33353d.svg)
 * [HyperDB](https://wordpress.org/plugins/hyperdb/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/hyperdb/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/hyperdb/)
 * [Active Topics](https://wordpress.org/support/plugin/hyperdb/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/hyperdb/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/hyperdb/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [JordanThurston](https://wordpress.org/support/users/jordanthurston/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/hyperdb-causing-frequent-mysql-connection-errors/#post-3837624)
 * Status: not resolved