Diagnosing Firebird connection pool exhaustion when MON$ATTACHMENTS queries consume scarce attachments
0 reputation · 17 Dec 2020, 04:13 UTC
0 reputation · 17 Dec 2020, 04:13 UTC
Firebird's MON$ATTACHMENTS table exposes live server attachments with columns such as MON$ATTACHMENT_ID, MON$STATE, MON$REMOTE_ADDRESS, and MON$TIMESTAMP, making it the primary tool for identifying leaked or long-held connections. However, querying this monitoring table requires a separate privileged attachment, which itself counts against the server's MaxAttachments limit and any OS file-descriptor or process ceiling that applies to the chosen architecture (SuperServer, SuperClassic, or Classic). When the connection pool is genuinely exhausted, the diagnostic query can fail or worsen the contention it attempts to measure.
Client-side pools such as Jaybird enforce their own max-connection, idle-timeout, and validation settings independently of firebird.conf, so the attachment count visible in MON$ATTACHMENTS may not map directly to the pool configuration. Correlating MON$TIMESTAMP values with application logs helps determine whether attachments are created faster than they are returned, but this correlation requires the monitoring query to succeed during the exhaustion window.
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.