When a client connection fails, the OpenSwitch default behavior is to immediately close down the outgoing connection to the remote Adaptive Server. However, for applications that rapidly create connections, issue a small query, then close the connection, the OpenSwitch default behavior can impose significant overhead.
To override the default OpenSwitch behavior, supply the optional CACHE value when you define a pool.
You create pools either using the GUI configuration
tool during or after installation, by using OpenSwitch Manager,
or by manually editing the OpenSwitch configuration file. You specify CACHE values
by manually editing the OpenSwitch configuration file.
See Chapter 3, “Configuring OpenSwitch” in the OpenSwitch Installation Guide and Chapter 5, “Using the Configuration File” in this book for more information.
The CACHE value indicates the number of seconds that an outgoing connection is maintained after a client application disconnects from an Adaptive Server.
For example:
[POOL=POOL_A:MODE=CHAINED,CACHE=30] servers: ... connections: type: site
This configuration example specifies that all users of the pool maintain cached copies of their outgoing connection for up to 30 seconds following a disconnection.
If the same client attempts to reconnect using the same user name and password, the connection is immediately reassigned to the user without creating a new outgoing connection. If 30 seconds has passed (the CACHE value) and no client has attempted a connection, the connection is dropped.
Changing the CACHE duration of a pool does not affect existing cached connections—it only affects the caching of future connections.To manage or change the cache value associated with a pool in a running OpenSwitch, use the rp_pool_cache registered procedure. Changing the caching time on a pool does not affect existing cached connections, it affects only the caching of future connections. See rp_pool_cache for more information.