Configuration of Db2 workload balancing support for non-Java clients

For connections to Db2 data servers in a Db2 pureScale® instance, connection-level workload balancing is enabled at a non-Java client by default. Transaction-level workload balancing capability must be enabled explicitly.

The following table describes the basic settings to enable connection-level workload balancing support for non-Java™ applications.

Table 1. Basic settings to enable Db2 connection-level workload balancing support in non-Java applications
Client setting Value
Connection address:
database host1 The IP address of a member of a Db2 pureScale instance.2
database port1 The SQL port number of a member of a Db2 pureScale instance2
database name1 The database name
Note:
  1. Depending on the client that you use, connection information is defined in one of several possible sources:
    • If you are using one of the data server drivers or a CLI or open source application that uses IBM® Data Server Client or IBM Data Server Runtime Client:
      • If host, port, and database information is provided in a connection string in an application, Db2 uses that information.
      • If host, port, and database information is not provided in the connection string in an application, the driver uses a db2cli.ini file, and this information is provided in the db2cli.ini file, Db2 uses that information.
      • If host, port, and database information is not provided in the connection string in the application or the db2cli.ini file, the Db2 driver uses the information in the db2dsdriver.cfg configuration file.
    • If you are using a .NET application or an application that uses embedded SQL with the IBM Data Server Client or the IBM Data Server Runtime Client, connection information comes a source that is not the db2dsdriver.cfg configuration file. Possible sources include the database catalog, connection string, db2cli.ini file, or .NET object properties.
  2. Alternatively, you can use a distributor, such as Websphere Application Server Network Deployment, or multihomed DNS to establish the initial connection to the database.
    • For a distributor, you specify the IP address and port number of the distributor. The distributor analyzes the current workload distribution, and uses that information to forward the connection request to one of the members of the Db2 pureScale instance.
    • For multihomed DNS, you specify an IP address and port number that can resolve to the IP address and port number of any member of the Db2 pureScale instance. Multihomed DNS processing selects a member based on some criterion, such as simple round-robin selection or member workload distribution.

The following configuration keyword in the db2dsdriver.cfg file can be used to change the connection-level workload balancing setting.

Table 2. Setting to control connection-level workload balancing behavior
Element in the db2dsdriver.cfg configuration file Section Value
connectionLevelLoadBalancing parameter <database> Specifies whether connection-level load balancing is in effect. It is true by default.

You can use the following configuration keywords in the db2dsdriver.cfg file to enable and fine-tune transaction-level workload balancing.

Table 3. Settings to control transaction-level workload balancing behavior
Element in the db2dsdriver.cfg configuration file Section Value
connectionLevelLoadBalancing parameter <database> Must be set to true if you want to use transaction-level workload balancing. The setting is true by default unless the server accessed is a Db2 for z/OS® server; in that case, the default is false.
enableSeamlessFailoverErrorCodes keyword <acr> Specifies whether the CLI Driver maps non-seamless errors, such as SQL30108N, SQL20542N, to the communication error SQL30081N. If the property value is set to false and any non-seamless error happens during the execution, then the driver sends a SQL30081N communication error to the application. This new behavior is seen when the enableWLB property is set to true and the servers are Db2 or Db2 for z/OS. If the enableSeamlessFailoverErrorCodes property is set to true, the application receives seamless error codes (SQL30108N, SQL20542N) in case of non-seamless failover. The default value of enableSeamlessFailoverErrorCodes is false for Db2 for z/OS and true for Db2.
enableWLB parameter <wlb> Specifies whether transaction-level workload balancing is in effect. It is false by default.
maxTransportIdleTime <wlb> Specifies the maximum elapsed time in number of seconds before an idle transport is dropped. The default is 60 . The minimum value is 0.
maxTransportWaitTime <wlb> Specifies the number of seconds that the client waits for a transport to become available. The default is 1. Specifying a value as -1 means unlimited wait time. The minimum supported value is 0.
maxTransports <wlb> Specifies the maximum number of physical connections can be made for each application process that connects to the Db2 pureScale instance.The default is -1 which means establish as many as needed.
maxRefreshInterval <wlb> Specifies the maximum elapsed time in number of seconds before the server list is refreshed. The default is 10. The minimum supported value is 0.
For CLI, OLE DB, ADO.NET, and embedded SQL applications, there are three connection timeout keywords, which you can set in the IBM data server driver configuration file (db2dsdriver.cfg):
tcipipConnectionTimeout
The tcipipConnectionTimeout keyword specifies the number of seconds before an attempt to open a socket fails
ConnectionTimeout
The ConnectionTimeout keyword specifies the number of seconds that a client application waits for a connection to be established.
MemberConnectTimeout
The MemberConnectTimeout keyword specifies the number of seconds that a client application waits before being routed to the next IP address in the server list.
The ConnectionTimeout keyword setting takes precedence over the tcpipConnectTimeout and MemberConnectTimeout keyword settings.