sysown / proxysql

High-performance MySQL proxy with a GPL license.
http://www.proxysql.com
GNU General Public License v3.0
5.97k stars 973 forks source link

Check if Multiplexing is working #4694

Open MichalisDBA opened 1 week ago

MichalisDBA commented 1 week ago

Hello.

We have a simple scenario that uses only mysql_servers arranged in hostgroups and mysql_users that connect to specific hostgroups.

We are not using any query_rules or any other dynamic routing based on master / slave etc.

How can i test on-demand if multiplexing is working? How can i produce scenarios that enables or disables multiplexing based on queries that are issued and track them?

For what i understand only stats_mysql_connection_pool shows the connection pool? Where can i see and track if multiplexing was on or off?

Thank you.

MichalisDBA commented 5 days ago

Hey @renecannao .

Sorry for my ignorance but i can not seem to understand how Multiplexing works in real life examples.

What i have seen is.

Without ProxySQL we have 10 client apps that do simultaneously 10 connections to backend. The connections in the database open and close.

With ProxySQL the same 10 connections open and stay idle until they will be reused.

The things is if more connections are coming from different systems, with or without proxysql the connections that the database will accept is defined in the max_connections. Both in DB server and ProxySQL.

I thought ProxySQL can handle for example 10 client connections with 1 backend connection, but what i see is that if 10 client connections are established simultaneously or connections that the queries are not executing fast enough through ProxySQL, then the same 10 backend connections are being used.

So how ProxySQL compares to direct database connections if in this example 10 client apps can not use 1 backend connection with ProxySQL?