Proxysql process list analysis

Hi,
I would like to know when will these connections in stats_mysql_processlist be closed by default by proxysql. Why user and and client has some imaginary values ? Will this be counted in by proxysql to find the max front-end connections.

select * from stats_mysql_processlist;
+----------+-----------+----------------------+----+------------+----------+-----------+------------+------------+----------+----------+-------------------+---------+------+--------------+---------------+
| ThreadID | SessionID | user                 | db | cli_host   | cli_port | hostgroup | l_srv_host | l_srv_port | srv_host | srv_port | command           | time_ms | info | status_flags | extended_info |
+----------+-----------+----------------------+----+------------+----------+-----------+------------+------------+----------+----------+-------------------+---------+------+--------------+---------------+
| 1        | 56508     | unauthenticated user | NULL | 10.59.2.50 | 40386    | -1        | NULL       | NULL       | NULL     | NULL     | Connecting client | 0       | NULL | NULL         | NULL          |
| 2        | 56529     | unauthenticated user | NULL | 10.59.2.50 | 58514    | -1        | NULL       | NULL       | NULL     | NULL     | Connecting client | 0       | NULL | NULL         | NULL          |
+----------+-----------+----------------------+----+------------+----------+-----------+------------+------------+----------+----------+-------------------+---------+------+--------------+---------------+
2 rows in set (0.01 sec)
mysql> 
mysql> select * from stats_mysql_users;
+-----------------+----------------------+--------------------------+
| username        | frontend_connections | frontend_max_connections |
+-----------------+----------------------+--------------------------+
| abcd            | 0                    | 5                        |
| abc             | 0                    | 5                        |

How to avoid/remove those stale entries. Any leads would be really helpful.

Thanks ahead!

1 Like

Hi, I believe these are controlled by ProxySQL mysql-connect_timeout_client parameter (10 sec is the default value). Did you try lowering that ?

1 Like

Hi, Thanks for the reply. I don’t have that global variable.
Sharing the connect_timeout variables listed in proxysql

+----------------------------------+----------------+
| variable_name                    | variable_value |
+----------------------------------+----------------+
| mysql-connect_timeout_server_max | 10000          |
| mysql-monitor_connect_timeout    | 600            |
| mysql-connect_timeout_server     | 3000           |
+----------------------------------+----------------+

Proxsyql version - 2.0.13

Am i missing anything here ?

1 Like

@preethi_subbu,
The -1 hostgroup is because the user isn’t authenticated yet and thus proxysql has not viewed any connection information and thus cannot determine yet which hostgroup to route the connection. This is expected.

You can kill those connections in the proxysql admin KILL CONNECTION 1

2 Likes

Thanks for the reply. Will this be taken into consideration by proxysql as front-end connection ?

We got too many connections error as connections exceeded than configured mysql-max_connections.

MySQL_Session.cpp:4491:handler___status_CONNECTING_CLIENT___STATE_SERVER_HANDSHAKE(): [WARNING] mysql-max_connections reached. Returning 'Too many connections'

At that time stats_mysql_processlist had lot of stale entries. Could you confirm whether these entries will be added as current front-end connections ?

1 Like