How long will a unused connection will be put back to mysql

183 views
Skip to first unread message

Steve Zheng

unread,
Sep 18, 2022, 1:37:42 PM9/18/22
to proxysql
Hi,
I use ProxySQL in front of MySQL database and set using connection pool mysql-multiplexing = True.

From MySQL monitor, the connections count is stable at 500. 

There was an bug in my application, it created too many connections last week. From MYSQL monitor, the connection was 900. 
I fixed the issue this Monday and wait for 1 week, but the connection still 900

I restarted ProxySQL just now, the mysql connection drop to 500.

It seems ProxySQL doesn't release connection to the backend database once it created.
Do I have to restart ProxySQL periodically to release the connections?

Thank you.

René Cannaò

unread,
Sep 18, 2022, 2:10:35 PM9/18/22
to Steve Zheng, proxysql
Hi Steve,


Either your application is sending some query pattern that causes multiplexing to be disabled (see https://proxysql.com/documentation/multiplexing/) , or you have mysql_servers.max_connections severely misconfigured.

Thanks,
René

--
You received this message because you are subscribed to the Google Groups "proxysql" group.
To unsubscribe from this group and stop receiving emails from it, send an email to proxysql+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/proxysql/f25a0705-b161-4c8a-bf58-3e07117e3cf3n%40googlegroups.com.

David Krupicka

unread,
Sep 18, 2022, 2:49:02 PM9/18/22
to René Cannaò, Steve Zheng, proxysql
Hi,

I figured out recently, that with multiplexing, ProxySQL maintains the connections by pinging them, so it keeps them alive.

Maybe I'm not precise, but it's clear, at least to me, that it relates mysql-wait_timeout. My setup has it set to 5 hours, whilst the ping is configured to ping the connection every 10 seconds. Therefore, connections are shown as idle (or take it as ready to be reused) and they will be terminated only after the timeout. Until then, ProxySQL keeps them alive.

Best regards
David

Dne ne 18. 9. 2022 20:10 uživatel René Cannaò <rene....@gmail.com> napsal:
Reply all
Reply to author
Forward
0 new messages