sysown / proxysql

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

SQLAlchemy connection disconnects after 5 minutes of inactivity with ProxySQL 2.0.9 #4736

Open hert525 opened 3 weeks ago

hert525 commented 3 weeks ago

Description:

I am experiencing an issue with ProxySQL version 2.0.9 where connections to MySQL through SQLAlchemy disconnect after about 5 minutes of inactivity. Both ProxySQL and MySQL have wait_timeout and interactive_timeout set to 4 hours, but connections are still being dropped much sooner than expected.

Steps to Reproduce:

Set up ProxySQL 2.0.9 and configure wait_timeout and interactive_timeout on both ProxySQL and MySQL to 4 hours. Connect to MySQL through ProxySQL using Python with SQLAlchemy. Allow the connection to remain idle for 5 minutes. Observe that the connection disconnects and an error message is displayed. Expected Behavior:

The connection should remain active for up to 4 hours of inactivity, consistent with the wait_timeout and interactive_timeout configurations.

Observed Behavior:

The connection disconnects after about 5 minutes of inactivity. The error message received is:

The client was disconnected by the server because of inactivity, see wait_timeout and interactive_timeout

Additional Information:

ProxySQL version: 2.0.9 SQLAlchemy version: [specify your SQLAlchemy version here] Python version: [specify your Python version here] Both wait_timeout and interactive_timeout are configured to 4 hours on both ProxySQL and MySQL. Any insights or suggestions to resolve this issue would be greatly appreciated. Thank you!

Let me know if you'd like any adjustments.