Auto close/ping "closed" connection

13 views
Skip to first unread message

Karol Bieniaszewski

unread,
Nov 2, 2021, 8:23:55 AM11/2/21
to firebird...@googlegroups.com

Hi

 

The case:

100 Users connect to database. And 5 of tchem are in one building.

There is power failture on that building. On Firebird side connections are still alive and all pending transactions too.

Such transactions can block other user activity (also same user which got power failture too when he is back now).

 

The questions:

 

  1. How can i check on the Firebird server side that connection is still alive by e.g. „ping” it.
  2. After what time will Firebird close such lost connections itself?

 

Regards,

Karol Bieniaszewski

 

Dimitry Sibiryakov

unread,
Nov 2, 2021, 8:27:58 AM11/2/21
to firebird...@googlegroups.com
Karol Bieniaszewski wrote 02.11.2021 13:23:
> The questions:
>
> 1. How can i check on the Firebird server side that connection is still alive
> by e.g. „ping” it.

No way to check it.

> 2. After what time will Firebird close such lost connections itself?

After OS detect it by KEEP ALIVE packet. You can configure it to use shorter
timing.

--
WBR, SD.

Stefan Heymann

unread,
Nov 2, 2021, 9:28:49 AM11/2/21
to firebird...@googlegroups.com
> On Firebird side connections are still alive and all pending transactions too.

In TCP terms, this is a "half-open" connection.

> 1. How can i check on the Firebird server side that connection is still alive by e.g. „ping” it.

I don't know if there is something like a ping. However, you can use

select * from mon$attachments

to see all attachments and you can use

delete from mon$attachments where mon$attachment_id = :attachment_id

to "cut off" a specific attachment.


> 2. After what time will Firebird close such lost connections itself?

This "Keepalive" time is defined in the TCP/IP stack of the operating system. In Windows, the default is 2 hours.

However, there is a setting in firebird.conf that you can change. And I would also recommend you change it. The setting is named:

DummyPacketInterval

When it is set to 0 (the default), then the OS default is used (2 hours). When you set it to 120, this means the Keepalive time is 120 seconds (2 minutes), which is a good value. Firebird will then send an out-of-band "keepalive" message to all clients that have been silent for the last 2 Minutes. Those clients who do not respond to the keepalive message will be detached.

Remember to restart the Firebird service after changing this setting so it can get effective.


HTH

Regards

Stefan



----- Ursprüngliche Nachricht / Original Message -----
Von/From: Karol Bieniaszewski <livius...@poczta.onet.pl>
Gesendet/Date: 02.11.2021 13:23
An/To: firebird...@googlegroups.com <firebird...@googlegroups.com>
Betreff/Subject: [firebird-support] Auto close/ping "closed" connection

Hi

The case:
100 Users connect to database. And 5 of tchem are in one building.
There is power failture on that building. On Firebird side connections are still alive and all pending transactions too.
Such transactions can block other user activity (also same user which got power failture too when he is back now).

The questions:

1. How can i check on the Firebird server side that connection is still alive by e.g. „ping” it.
2. After what time will Firebird close such lost connections itself?

Regards,
Karol Bieniaszewski

--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/4Hk8Fx0hGyz1tMB%40smtp.poczta.onet.pl.

Karol Bieniaszewski

unread,
Nov 3, 2021, 1:21:22 PM11/3/21
to firebird...@googlegroups.com

Thank you both

 

I know about DummyPacketInterval but is it possible to send such packet manually?

I as as in Interbase performance moinitor i can click ping attachemnt or ping all attachemnts buton.

Maybe in Firebird is also such option?

 

Regards,

Karol Bieniaszewski

Reply all
Reply to author
Forward
0 new messages