mysql icon indicating copy to clipboard operation
mysql copied to clipboard

Mysql timeout configurations not being respected

Open BayoKwendo opened this issue 5 years ago • 9 comments

I have been monitoring my deno mysql application for sometime now. Even though i included everything suggested for this driver , idletimout etc but my application keeps on disconnecting after idle for 10 minutes or more.,, i am just stuck and wondering why deno cant respect MySQL configurations. And wait why cant you implement keep-alive function

BayoKwendo avatar Oct 15 '20 09:10 BayoKwendo

More information is needed.

What are the value of MySQL server wait_timeout and the deno_mysql idleTimeout option?

Does deno_mysql connect to a remote MySQL server or a localhost one? If connecting remotely, the TCP connection can be broken due to unstable network or router NAT timeout etc. If it is the case, try setting idleTimeout to a lower value, 60000 (1 minute) for example.

lideming avatar Oct 15 '20 09:10 lideming

I have set MySQL server timeout configurations to be 24 hours and idletimeot to be 3 hours. MySQL is hosted remotely. and still been experiencing this.

BayoKwendo avatar Oct 15 '20 09:10 BayoKwendo

So I think there is some network problem between the client and the server.

You can set idleTimeout to 300000 (5 minutes) and see if the problem still persists.

I will consider implementing heartbeat packets in deno_mysql.

lideming avatar Oct 15 '20 09:10 lideming

Great, lemme try,, heartbeat packet would be the best solution

BayoKwendo avatar Oct 15 '20 09:10 BayoKwendo

Any hope for us.. the heartbeat thing?

BayoKwendo avatar Oct 16 '20 13:10 BayoKwendo

Seems that there is no heartbeat in the protocol of MySQL. Maybe using idleTimeout is the correct way.

lideming avatar Oct 16 '20 13:10 lideming

ok but unfortunately idleTimout is not being respected also. I have test and test all with the same result after 10 minutes "connection closed"

BayoKwendo avatar Oct 18 '20 01:10 BayoKwendo

@BayoKwendo Is there "connection idle timeout" before "connection closed"?

lideming avatar Oct 18 '20 03:10 lideming

It varies, sometimes it say closed unexpectedly, sometime connection idle timeout then connection closed

BayoKwendo avatar Oct 18 '20 09:10 BayoKwendo

Can't reproduce the problem. Close it for now.

lideming avatar Nov 25 '22 15:11 lideming