I'm connecting to a Firebird SQL Server version 3 with a C# application using Firebird .NET Client 9.1.1. Once the application is started 3 connections to the server are established using a connection pool. When the application quits in a normal way, all connections are closed. When the application is killed e.g. using the task manager or due to session timeout in the remote desktop only two connections are closed and one connection survives. These 'broken connections' idle since then. What do I need to set that these connections are killed, e. g. after 24 hours? I found an idle timeout setting for Firebird SQL Server 4.0 (https://firebirdsql.org/file/documentation/chunk/en/refdocs/fblangref40/fblangref40-management-timeouts.html), but not for Firebird SQL Server 3.0.
I'm updating the question as I tried several things especially Marc Rotteveel mentioned:
- The server is
ISQL Version: LI-V3.0.5.33100 Firebird 3.0running on Debian 10. If it's not needed to fix the issue I would like to postpone updating firebird - I checked the PIDs on client side, there are no processes with these IDs
- Another idea that came to my mind while writing this: We use
RemoteAuxPort = 6032to receive server sent events on the client side. Can the issue be related to this setting? - I added
#
# Seconds to wait on a silent client connection before the server sends
# dummy packets to request acknowledgment.
#
...
# Per-connection configurable.
#
# Type: integer
#
DummyPacketInterval = 1800
in the firebird.conf and restarted the server. However there are still connections being established four weeks ago (last server restart) but with the PIDs (e. g. 11280) not being present on the client anymore:



First, make sure you're querying an up-to-date snapshot of the monitoring tables. Once any monitoring table has been queried in a transaction, all other queries to any monitoring table will have a stable snapshot. You need to start a new transaction to get a new monitoring snapshot.
Second, you didn't specify which Firebird 3.0 version you're using: make sure you're using the latest version (3.0.10 at this time).
The termination of those connections should be detected eventually, and then they should be cleaned out. Normally, Firebird relies on the
SO_KEEPALIVEsocket option to detect broken connections. With the default TCP/IP settings on Windows, it should detect a broken connection within 2 hours.If that doesn't happen (or not soon enough for your taste), you can check your Windows TCP/IP settings to check if the TCP keepalive setting has been modified or disabled (recent Windows versions no longer allow this to be disabled), in registry entry
HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters(specificallyKeepAliveTimeandKeepAliveInterval, if these keys are absent, the defaults are applied, on older Windows versions keepalive is disabled whenTcpMaxDataRetransmissionsis set to 0).Alternatively, you can set the
DummyPacketIntervalinfirebird.confto a non-zero value.The
DummyPacketIntervalis a value in seconds where the server will send a "dummy" packet if a connection has been idle for at least that length of time. If a connection is gone, attempting to send that dummy packet will result in an error, which will make Firebird recognize the connection is no longer there.Don't set the value too low, that will just result in unnecessary load and network traffic. I'd suggest to use an interval of 30 minutes (1800 seconds) or even higher.