node-mysql2
node-mysql2 copied to clipboard
Pooling connections destroy
Created a config property idleTime to destroy the pool connection.If not set then it will work as default.
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 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