Problem: "Host 'host_name' is blocked"
Solution:
- increase your max_connect_errors setting in /etc/my.cnf
- investigate and resolve the reason for your connection failures.
The way that I discovered this MySQL "feature" is by observing a strange phenomenon. Periodically, during peak traffic hours, our servers would lose connection to the database.
The database would continue running, the firewall rules were clear, but for some unknown reason, MySQL would simply refuse the connection.
Apparently, according to the MySQL Documentation for max_connect_errors:
"If there are more than this number of interrupted connections from a host, that host is blocked from further connections. "
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_max_connect_errors
The default value for max_connect_errors is 10, that means that your application will get BANNED after 10 connection failures. Well, a good question to ask is: what exactly is meant by connect errors?
It seems that connections that take more than connect-timeout seconds to complete are considered as connect errors,
therefore setting the connect-timeout setting too low will cause an increase in connection failures, and therefore cause your application to get banned.
No comments:
Post a Comment