Operation of workload balancing for connections to Informix from non-Java clients
Workload balancing (also called transaction-level workload balancing) for connections to IBM® Informix contributes to high availability by balancing work among servers in a high-availability cluster at the start of a transaction.
The following overview describes the steps that occur when a client connects to an IBM Informix Connection Manager, and workload balancing is enabled:
- When the client first establishes a connection using the IP address
of the Connection Manager, the Connection Manager returns the server
list and the connection details (IP address, port, and weight) for
the servers in the cluster.
The server list is cached by the client. The default lifespan of the cached server list is 30 seconds.
- At the start of a new transaction, the client reads the cached
server list to identify a server that has untapped capacity, and looks
in the transport pool for an idle transport that is tied to the under-utilized
server. (An idle transport is a transport that has no associated connection
object.)
- If an idle transport is available, the client associates the connection object with the transport.
- If, after a user-configurable timeout, no idle transport is available in the transport pool and no new transport can be allocated because the transport pool has reached its limit, an error is returned to the application.
- When the transaction runs, it accesses the server that is tied to the transport.
- When the transaction ends, the client verifies with the server that transport reuse is still allowed for the connection object.
- If transport reuse is allowed, the server returns a list of SET
statements for special registers that apply to the execution environment
for the connection object.
The client caches these statements, which it replays in order to reconstruct the execution environment when the connection object is associated with a new transport.
- The connection object is then dissociated from the transport, if the client determines that it needs to do so.
- The client copy of the server list is refreshed when a new connection is made, or every 30 seconds, or at the user-configured interval.
- When workload balancing is required for a new transaction, the client uses the previously described process to associate the connection object with a transport.