Subject | Re: [firebird-support] Concurrent Usage Limiting via Application |
---|---|
Author | Stefan Heymann |
Post date | 2006-05-12T15:33:51Z |
Hi Tom,
the users that are connected to the database (including yourself).
When you use Delphi and IbObjects you can use the IB_Connection.Users
property to get this list.
When I start my application, I retrieve this list and count the number
of currently attached users. As I don't use the Firebird security
mechanism to authenticate users (there is my own USERS table in my
database, which I find more convenient), all my users attach to the
database using the same Firebird user name. I only count the
connections from this user name so users that are connected as, say,
SYSDBA will not be counted (e.g. administrators using a DB tool).
Firebird server still keeps them in its list. The only way to reset
the list seems to be a restart of the Firebird service.
However, in firebird.conf there is a setting DummyPacketInterval, the
description mentions KEEPALIVE messages:
that so far but "DO NOT USE THIS OPTION" doesn't sound very
encouraging ...
Being able to get a list of connected users with their IP address, OS
user name, client application name/identifier and timestamp of
connection would be my number one wish for any future release of
Firebird. For me, that would be more important and helpful than, say,
further speed improvements of the SQL query optimizer ...
Best Regards
Stefan
--
Stefan Heymann
www.destructor.de/firebird
> FB is currently our default databaseSame here :-)
> and if anyone has any tips on how to handle/limit concurrent usageThe only thing you can currently do is retrieve a list of the names of
> from an application then it would be appreciated.
the users that are connected to the database (including yourself).
When you use Delphi and IbObjects you can use the IB_Connection.Users
property to get this list.
When I start my application, I retrieve this list and count the number
of currently attached users. As I don't use the Firebird security
mechanism to authenticate users (there is my own USERS table in my
database, which I find more convenient), all my users attach to the
database using the same Firebird user name. I only count the
connections from this user name so users that are connected as, say,
SYSDBA will not be counted (e.g. administrators using a DB tool).
> We currently use a per-machine registration code but would like toThat's difficult and unprecise. Mainly because ...
> monitor and limit connections instead.
> Also, does anyone know if it possible to track untimely client... of this one: it's not possible. When a connection gets lost, the
> disconnections?
Firebird server still keeps them in its list. The only way to reset
the list seems to be a restart of the Firebird service.
However, in firebird.conf there is a setting DummyPacketInterval, the
description mentions KEEPALIVE messages:
> # Seconds to wait on a silent client connection before the server sendsMaybe the last article on Microsoft's homepage can help. I didn't try
> # dummy packets to request acknowledgment.
> #
> # DO NOT USE THIS OPTION. It may hang or crash Windows on the client side as
> # explained here: http://support.microsoft.com/default.aspx?kbid=296265
> # or may not prevent eventual inactive client disconnection for other OS.
> #
> # Normally, Firebird uses SO_KEEPALIVE socket option to keep track of
> # active connections. If you do not like default 2-hour keepalive timeout
> # then adjust your server OS settings appropriately. On UNIX-like OS's,
> # modify contents of /proc/sys/net/ipv4/tcp_keepalive_*. On Windows,
> # follow instrutions of this article:
> # http://support.microsoft.com/default.aspx?kbid=140325
that so far but "DO NOT USE THIS OPTION" doesn't sound very
encouraging ...
Being able to get a list of connected users with their IP address, OS
user name, client application name/identifier and timestamp of
connection would be my number one wish for any future release of
Firebird. For me, that would be more important and helpful than, say,
further speed improvements of the SQL query optimizer ...
Best Regards
Stefan
--
Stefan Heymann
www.destructor.de/firebird