node-mysql2 icon indicating copy to clipboard operation
node-mysql2 copied to clipboard

Pooling connections destroy

Open saravjotsingh opened this issue 6 years ago • 2 comments

Created a config property idleTime to destroy the pool connection.If not set then it will work as default.

saravjotsingh avatar Dec 05 '19 08:12 saravjotsingh

I personally think this logic would be better handled by passively checking for idle time. Track the last timestamp a query completed, and when the pool is checking for a connection, have it check the idle time.

perry-mitchell avatar Apr 20 '22 17:04 perry-mitchell

@perry-mitchell that means if a node had a spike of load and opened 10 db connections but then there is no traffic it'll keep 10 connections open. For mysql a connection usually means full os thread with stack memory allocation and other resources that are unavailable until connection is closed

sidorares avatar Apr 21 '22 06:04 sidorares