Hi,
I have a MariaDB Galera Cluster version 10.3 with 3 nodes and ProxySQL version 2.4.8-2-g2cc900a in front of the nodes. Application connecting to the database sends around 250k requests per minute during peak hours, but creates a connection pool with only 300 connections. Basically it uses that connection pool of 300 connections to send any requests to the database. What happens during peak hours is that too many connections reach to the MariaDB nodes on the backend from ProxySQL that the whole cluster goes out of sync and fails. From the ProxySQL log file I see the following logs:
MySQL_Session.cpp:5335:handler___status_CONNECTING_CLIENT___STATE_SERVER_HANDSHAKE(): [WARNING] mysql-max_connections reached. Returning 'Too many connections'
MySQL_Session.cpp:5335:handler___status_CONNECTING_CLIENT___STATE_SERVER_HANDSHAKE(): [WARNING] mysql-max_connections reached. Returning 'Too many connections'
MySQL_Session.cpp:5335:handler___status_CONNECTING_CLIENT___STATE_SERVER_HANDSHAKE(): [WARNING] mysql-max_connections reached. Returning 'Too many connections'
MySQL_Session.cpp:5335:handler___status_CONNECTING_CLIENT___STATE_SERVER_HANDSHAKE(): [WARNING] mysql-max_connections reached. Returning 'Too many connections'
This issue does not happen often, maybe once every few months and it does not have a specific pattern that we can reproduce. We tried to reproduce the issue by generating high amount of load to the database, but nothing happened. In attempts to solve the issue at some point we disabled multiplexing completely after reading in some forums that it might cause issues and create more connections on the backend about some types of queries and since the application only creates a connection pool of 300 connections we disabled it. I am aware that the ProxySQL and MariaDB are over a year old and a lot might have improved since then, but before considering the upgrade (which we will have to at some point) I wanted to ask if someone else had such issues and if yes how did they solve it. Another important information could be that the application is from a 3rd party vendor and I don't have much control over it. Besides changing some parameters which are relevant to the workflow we have I cannot control anything else. Especially in terms of how it interacts with the database. MariaDB allows 1000 connections. Please let me know what else I should provide to help troubleshoot the issue.
Kind Regards,
Fatbardh