Subject Re: [firebird-support] difference fb as a service - as an application
Author Helen Borrie
At 10:29 AM 20/05/2006, you wrote:
>i was wondering the other day whats exactly that difference between fb
>as a service an fb as an application

Programmatically, no difference at all. It is the same executable.
The difference is in who/what is controlling the execution of the
program. When run as a service, the program is always under the
control of a predefined user. By default, this is the localsystem
user, an internal Windows user that has great powers (actually, more
powers than are needed; it's recommended to change this, but that's
a different topic...) When run as an application, the program is run
in the application space of the Windows user that executes it.

>i noticed that searches are a little bit faster when running as an
>application and from what the the quick start guide says about it i
>guess it has something to do with the difference between winxp and
>older versions of it but i don't really get it...

I wouldn't struggle to do so. There is no architectural reason why
differences in execution speed would exist, since the same code
executes in either case. Differences would be a factor of the state
of the database.

>can fb as an application also act as a remote service or is that an exclusive
>feature of the service?

Yes, of course. On Win98 and WinME it's not possible to run the
Firebird server as a service but you can still connect to the
Firebird server application from remote clients via TCP/IP if it is
installed. The embedded server model must, by its nature, run as an
application regardless of platform and accept only a local client.

So, apart from these factors, there is no sense in running either the
superserver or the Classic "parent" as applications. Servers provide
services. The whole "service host" subsystem on Windows server
platforms is designed for providing services.

>whats the difference all about...

When Firebird superserver runs as an application but is acting as a
server, you need to have the Guardian application running. It
monitors the server and restarts it if it shuts down abnormally.

You don't need the Guardian if the superserver is running as a
service, because you can set the service to be restarted by the
services subsystem if it ends abnormally. Indeed you *should* do
that for Firebird Classic: set it to run as a service, disable the
Guardian and set the service to restart the executable if
required. That way you will ensure that only the parent
fb_inet_server.exe process gets restarted and not the child processes
(which, if aborted, should be left to time out, rather than risk
being restarted and getting left behind as ghost connections.)