3

We have a simple monitoring that opens a TCP connection on port 3306 of the mariadb server to check if the server is reachable. mariadb logs this with the following message:

[Warning] Aborted connection to db: 'unconnected' user: 'unauthenticated' host: 'xxx' (This connection closed normally without authentication)

after 100 of these connections, mariadb does not allow any further connections from the monitoring-host:

Host 'IP' is blocked because of many connection errors; unblock with 'mariadb-admin flush-hosts'

of course we could set max_error_connections much higher or flush hosts regularly - but that's not what we want

is there a way to allow a specific host to make unlimited connections? or how could we solve the problem?

fx123
  • 31
  • 3
  • Which client API does the monitoring tool use? Did you run netstat -a on both client and server machine (for checking tcp limits) ? – Georg Richter Jan 04 '23 at 15:05
  • it's not about tcp limits. it's just mariadb that doesn't allow any more connections if there were too many bad ones. but we cannot change the monitoring –  Jan 04 '23 at 15:36
  • The solution is to find the reason for aborted connections, this could be a TCP problem. However this question should be moved to dba.stackexchange. – Georg Richter Jan 04 '23 at 15:55
  • 1
    the "problem" is that the monitoring simply opens a tcp connection to check whether the mysql server is still there and then closes the connection directly (without authentication) –  Jan 04 '23 at 16:16

1 Answers1

1

I fixed the abnormally noisiness of logs by pushing it down a warning level in MDEV-12274: Too many connections warning in error log (#2213).

The max_connect_error was mentioned in MDEV-21456 but I missed it. Attempts at a fix which is about to be reviewed.

There isn't a good workaround other than the two you've come up with for the time being.

danblack
  • 7,719
  • 2
  • 10
  • 27