During performance testing of our application I found that under extreme loads one problem that can occur is the occasional mysql connection error (i.e. at this stage I don't believe it is fair to call it a bug). Eventually the application will get blocked by mysql. I can extend the SET GLOBAL max_connect_errors=10000; (currently 10) but assuming 100% mysql uptime over a very very long time would this problem eventually reoccur?

This is the "blocked-host" feature of mysql:

Host 'host_name' is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts'

Without proactive intervention will the connection error count ever flush or otherwise decline?


I have found conflicting information, Percona recommend a very high limit ("around 1000000 is good") implying no. But elsewhere in the documentation states only successive errors are counted meaning yes, a single successful connection will flush the error count. DNS Lookup Optimization and the Host Cache

If too many of these occur successively from a given host without a successful connection, the server blocks further connections from that host. The max_connect_errors system variable determines the number of permitted errors before blocking occurs

Is anyone running mysql 5.6.5 where host_cache is exposed or know definitively?


Yes, they are successive connection errors


Does mysql connection error count ever flush?

No. The client host will be blocked until you execute a mysqladmin flush-hosts command or restart the MySQL server.

  • Thanks for the reply. The question is proactive and asking will the number of connection errors continue to increase before the host is blocked. I get the impression that if we expect very high traffic I will need to script a FLUSH every month – KCD Feb 24 '13 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.