Configuring component instance pool properties

To enable pooling, set the Pooling option on the Instances tab in the EAServer Manager Component Properties dialog box. You can set this property as com.sybase.jaguar.component.pooling if using jagtool.

You can configure the number of instances pooled for a component by configuring the properties in Table 3-2. These properties are found on the Resources tab in the EAServer Manager Component Properties dialog box.

Table 3-2: Component instance pooling properties

Property

Description

Maximum pooled instances

Specifies the maximum pool size. If the maximum pool size is reached, EAServer destroys excess instances after deactivation. The default is 0, which means no limit.

Minimum pooled instances

The minimum pool size. The default is 0.

Named instance pool

Specifies that the component shares space in a named instance pool, as described in “Named instance pools”.

Maximum active instances

Specifies the maximum number of instances that can exist at the same time. For a C++ component that runs as an external process, specifies the maximum number of simultaneously running external processes. If a request arrives when the maximum number of instances exist and are all busy, the request blocks, with blocking time constrained by the Maximum Wait setting.

Maximum wait

Specifies the maximum client wait time when the Maximum Active Instances property is set to specify a limit on the number of simultaneous active instances and the limit has been reached. The request blocks, with blocking time constrained by the Maximum Wait property. If the blocking time expires, the caller receives a CORBA::NO_RESOURCES exception.

While instance pooling can decrease client response time, it can also increase memory usage in the server. If pooled instances often sit idle, the memory used for pooling is wasted.

You can configure the maximum and minimum pool size to constrain the memory used to maintain an instance pool. For example, a heavily used component should have higher minimum and maximum pool sizes than a less commonly used component. If a component has periods of high use followed by low use, you can set a minimum size to allow the instances to be released during times of low use. Doing so frees memory for use by other components.

EAServer does not preallocate instances for the pool. The pool size grows as additional instances are required to satisfy client requests, up to the maximum specified size (if a maximum size is specified). Once the minimum pool size is reached, the size will not shrink below this size. To release idle pooled instances, EAServer has a garbage collector thread that runs periodically. Each time it runs, the garbage collector removes one idle instance from the pool, unless the minimum pool size has been reached.

If you configure a minimum pool size, configure a maximum size that is slightly larger. The difference between the maximum and minimum size provides a damping factor that prevents repeated instance allocation and deallocation if the actual pool size hovers near the minimum size.

If the maximum pool size is reached, EAServer still creates new instances, but destroys them immediately rather than placing them in the pool. You can set the Maximum Active Instances property to put an absolute limit on the number of instances that can run. Doing so allows you to partition the server resources among different components.

You can monitor the effectiveness of these settings by checking the Maximum Pooled Instances and Peak Maximum Instances Pooled setting for the package that contains your components. Ideally, the number of instances should rarely rise above the number of pooled instances. See “Using the Runtime Monitor” in the EAServer System Administration Guide for more information.