DBI pool connection timeout and server-side session alignment
19.6K reputation · 16 Nov 2021, 13:33 UTC
The pool package manages a cache of database connections to reduce handshake overhead, utilizing a validation mechanism and an idle timeout to reclaim resources. When integrating this with database servers that enforce their own strict idle-session timeouts, a discrepancy between the client-side pool timer and the server-side session limit can occur.
If the server terminates a session before the pool package identifies it as idle or performs a validation check, the application may encounter stale connection errors during checkout.
- What is the recommended configuration strategy to ensure the
poolidle timeout is synchronized with server-side session limits? - Does the validation function trigger automatically upon every checkout, or is it dependent on a specific time interval?