The Firebird Configuration File - Firebird

Firebird does not require the intense and constant reconfiguration that many other heavy-duty RDBMSs do. However, a range of configuration options is available for customizing a Firebird server and the host system on which it runs for your special needs.

The Firebird configuration file is named firebird.conf in all Firebird versions from 1.5 onward. In prior versions, its name depends on the operating system:

  • On Linux/UNIX, the name is isc_config.
  • On Windows, the name is ibconfig.

Several new parameters were added to version 1.5.

When a Firebird server process starts up, it reads the configuration file and adjusts its runtime flags to any non-default values contained in the configuration file. The file will not be read again until the next time the server is restarted. The default configuration parameters and their values are listed in the configuration file, commented out by # comment markers. It is not necessary to uncomment the defaults in order to make them visible to the server’s startup procedure.

Changing Configuration Parameters

It should be unnecessary to change any defaults until and unless you need to customize something. This procedure is not recommended if you lack a clear understanding of the effects.

A handful of default configuration settings that may be showstoppers for some legacy applications or non-default installations are discussed briefly here. A complete reference to all configuration parameters can be found in Chapter Configuration and Special Features. The configuration file can be edited with any plain text editor (e.g., vim in Linux or Notepad in Windows). Do not copy the file from a Windows machine to a Linux one, or vice versa, because the two systems store line breaks differently.

Parameter entries in firebird.conf are in the form

parameter_name = value

where parameter_name is a string that contains no white space and names a property of the server being configured, and value is a number, Boolean (1=True, 0=False), or string that specifies the value for the parameter.

To set any parameter to a non-default setting, delete the comment (#) marker and edit the value.

The Firebird 1.0.x ibconfig/isc_config parameter names and syntaxes are not interchangeable with those in firebird.conf. The format, size, and number of parameters are more restrictive.

The ibconfig/isc_config format is

parameter_name value

where the white space between the name and the value can be tabs or spaces, as desired, to please the eye. Each line of the file is limited to 80 characters. Unused parameters and installation defaults are commented with #.

On Linux, you should assume tha parameter names are case-sensitive.

The Firebird Root Directory

The root directory of your Firebird installation is used in many ways, both during installation and as an attribute that server routines, configuration parameters, and clients depend on. Because several ways exist to tell the server where to find a value for this attribute, developers and system administrators should be aware of the precedence trail that the server follows at startup, to determine it correctly.

  • On any platform, the first place the server looks is the (optional) global environment variable FIREBIRD. If it finds this variable, its value is used unconditionally.
  • If the FIREBIRD environment variable is not present, the next signpost on the trail applies to Windows platforms only. It seeks the Registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Firebird Project\Firebird Server\Instances

and looks for the field DefaultInstance. If it finds a valid directory path in this field, this is the value used. Other platforms do not have an equivalent signpost.

  • If the root directory is still not detected, then the interim root directory is assumed to be the level above the running process (..\ on Windows, ../ or the link to /proc/self/exe on POSIX, as applicable).
  • The startup procedure now looks in this location for the firebird.conf file. If it finds firebird.conf, it looks for the RootDirectory parameter. If this parameter is present, its value becomes the final root directory; otherwise, the interim value in step 3 becomes final.

Parameters Relating to File Access

Firebird has several parameters for protecting its files and databases from accidents and unauthorized access. If you are porting an existing database application or admin tool to Firebird 1.5, it may be important for you to refer to the section “The Firebird Configuration File” in Chapter Configuration and Special Features for detailed information about these parameters:

  • RootDirectory: This parameter can be used to configure the absolute path to a directory root on the local filesystem. It should remain commented unless you want to force the startup procedure to override the path to the root directory of the Firebird server installation, which it would otherwise detect for itself (see step 3 in the preceding section).
  • DatabaseAccess: In Firebird 1.0.x, the server can attach to any database in its local filesystem and is always accessed by applications passing the file’s absolute filesystem path. This parameter was introduced in v.1.5 to provide tighter security controls on access to database files and to support the database-aliasing feature.

The default installation configures this to Full, mimicking v.1.0.x behavior. Alternative options can restrict the server’s access to aliased databases only, or to databases located in specified filesystem trees.

  • ExternalFileAccess: This parameter replaces the external_file_directory parameter introduced in release 1.0. This parameter provides three levels of security regarding EXTERNAL FILES (fixed format text files that are to be accessed as database tables). If you are porting a database that defines any EXTERNAL FILE tables, you will need to configure this parameter in v.1.5 because it is disabled by default. Configuration is optional, although recommended, in v.1.0.x.
  • UDFAccess: This parameter is for protecting the locations where external code modules reside. It replaces not just the name of the optional v.1.0.x parameter, external_function_directory, but also the form in which the values are presented. Firebird 1.5 installs with access to external function libraries disabled by default, affecting many servers that previously allowed full access.
  • TempDirectories (tmp_directory in v.1.0.x): This parameter can be configured as one of the ways to allocate temporary sort space for the server in a specific disk location. Firebird 1.5 syntax is different from that of Firebird 1.0.x.

Other Parameters of Interest

The following parameters might be of interest in some hardware configurations:

  • CPUAffinityMask (cpu_affinity in v.1.0.x): This parameter can be used to assign the processors that a Windows Superserver is to use on an SMP machine. There is a problem, known as the “see-saw effect,” where the operating system continually swaps the entire Superserver process back and forth between processors on some SMP machines. The CPU affinity must be set to a single CPU if you encounter this problem.

By default, the affinity mask is set to use the first CPU in the array.

  • LockMemSize: This parameter is specific to Classic servers and represents the number of bytes of shared memory allocated to the memory table used by the lock manager. You may need to adjust this if you encounter the error “Lock manager is out of room” on Classic. Refer also to the LockHashSlots parameter in relation to this problem.
  • SortMemBlockSize and SortMemUpperLimit: These two parameters were added in v.1.5 to enable you to set and limit the amount of RAM the server uses for in-memory sorting. For Classic server, the default is too large to sustain more than a few connections.
  • DummyPacketInterval (dummy_packet_interval on v.1.0.x): This parameter is a relic from 16-bit systems that causes problems on 32-bit Windows. It was an old InterBase timeout parameter that was supposed to set the number of seconds (integer) the server should wait on a silent client connection before sending dummy packets to request acknowledgment. It is set by default to 0 on Firebird 1.5 (disabled) and to 60 on Firebird 1.0.x. It should be disabled (set to 0) on all Windows systems. Disabling it on other operating systems is also strongly recommended.
  • RemoteBindAddress: By default, clients may connect from any network interface through which the host server accepts traffic. This parameter allows you to bind the Firebird service to incoming requests through a single IP address (e.g., network card) and to reject connection requests from any other network interfaces. This helps to solve problems in some networks when the server is hosting multiple subnets. It is not supported on v.1.0.x.
  • CompleteBooleanEvaluation: This parameter can be used to revert the short Boolean evaluation logic used in Firebird 1.5 and higher to the full evaluation logic used in Firebird 1.0.x.
  • OldParameterOrdering: This parameter will be of interest to users of the IB Objects (IBO) data access components who are upgrading to Firebird 1.5 from v.1.0.x or InterBase. If your IBO version is lower than v.4.2, you should set this parameter to true as a temporary measure for compatibility until you upgrade IBO. It effectively “restores” an InterBase bug that scrambles stored procedure parameters in some conditions.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Firebird Topics