Using process instrumentation data for cache tuning

In the Server Admin area of the Process Admin Console, you can select Monitoring > Instrumentation to display process instrumentation data in the Instrumentation monitor. If the displayed data indicates an unexpectedly high number of cache misses for the cache settings, you can edit the 100Custom.xml files and override the problematic default values of the cache settings. This topic describes the persistent object (PO) factory cache settings and repository cache settings that are reflected in the PO Factory and Repository sections of the Instrumentation monitor. In some situations, you may need to override the default values for the cache settings with new values.

For more information about using the Instrumentation monitor to display or log process instrumentation data, see the topic Capturing process instrumentation data.

For both PO factory cache settings and repository cache settings, a cache hit rate of 90% is considered to be quite satisfactory. However, cache misses higher than 50% require some investigation. To improve the ratio of cache hits to cache misses, you can specify new values for the cache settings in the 100Custom.xml files. The new values will override the existing default values for the cache settings that are typically located in other XML configuration files, such as the 00Static.xml files. Generally, cache setting modification is an iterative task.

Note: Memory will not be pre-allocated according to the specified cache size. Caches are expandable up to the specified size.

For information about the use and location of the 100Custom.xml files and the associated XML configuration files, see the topic The 100Custom.xml file and configuration and its subtopics.

The PO Factory cache settings and Repository cache settings that are reflected in the Instrumentation monitor are described in the following sections:

For information about cache and cache-related settings that are not reflected in the Instrumentation monitor, see the topic Cache and cache-related settings.

PO factory cache settings

A persistent object (PO) factory is a class that is used to create persistent objects. There is a PO factory for each persistent object type and each PO factory has a cache for caching persistent objects of that type.

There are two types of PO factory settings in IBM BPM: versioned and unversioned. For a versioned persistent object, each time an object is changed, the new object is saved separately and does not overwrite the old version. This allows you to view changes over time. For an unversioned persistent object, only the latest modification is retained and older versions are discarded.

The following table lists the versioned and unversioned persistent objects that are located in the PO Factory > Cache Hits and PO Factory > Cache Misses sections of the Instrumentation monitor. The table also lists the corresponding PO factory cache settings that you might need to override to improve the ratio of cache hits to cache misses. All cache settings are enabled in the XML configuration files unless indicated otherwise.

Table 1. . PO factory cache settings
Type of PO in the Instrumentation monitor Setting and description Setting to add or update in the 100Custom.xml file

One of:

BPDArtifactReference
BPDParameter
Coach
CoachView
CoachResource
Contribution
Epv
Layout
Metric
ReportVariable
Scoreboard
TWClass
TWProcess
WebService

default-versioned-po-cache-size

This setting controls the number of objects in the versioned persistent object (PO) cache. The default value is 5000.

For low-volume environments with relatively few process applications and coaches, the default value may be sufficient. However, for more complex environments with many process applications or coaches, you may want to increase this value so that the process applications and coaches are held in the cache after their initial use. This step can improve response time when accessing these process applications and coaches.

Whenever the process instrumentation data indicates that there is an excessive number of PO Factory cache misses, you can increase the value of the versioned PO cache. You may need to iterate through multiple values until you determine the best value for your particular scenario. After changing the value, check the process instrumentation data again and adapt the value as needed.

The setting is located in the applicable 00Static.xml files, but updates to the default value of the setting must be made by adding the setting to the 100Custom.xml files.

<common>
   <default-versioned-po-cache-size merge="replace">7000
   </default-versioned-po-cache-size>
</common>

One of:

BPDInstance
BPDNotification
Branch
CaseProperty
Deployment
EnvironmentType
Favorite
GovernanceEvent
Installation
Project
ProjectSubscription
Snapshot
SmartFolder
Table
Task
User
UserGroup

default-unversioned-po-cache-size

This setting controls the number of objects in the unversioned persistent object (PO) cache. The default value is 1000.

For low-volume environments with relatively few process applications and coaches, the default value may be sufficient. However, for more complex environments with many process applications or coaches, you may want to increase this value so that the process applications and coaches are held in the cache after their initial use. This step can improve response time when accessing these process applications and coaches.

If the process instrumentation data indicates that there is an excessive number of PO Factory cache misses, you can increase the value of the unversioned PO cache. You may need to iterate through multiple values until you determine the best value for your particular scenario. After changing the value, check the process instrumentation data again and adapt the value as needed.

The setting is located in the applicable 00Static.xml files, but updates to the default value of the setting must be made by adding the setting to the 100Custom.xml files.

<common>
   <default-unversioned-po-cache-size merge="replace">2000
   </default-unversioned-po-cache-size>
</common>

Repository cache settings

The following table lists the repository cache settings that are reflected in the Repository section of the Instrumentation monitor. In some situations, you may need to override the cache setting values to improve the ratio of cache hits to cache misses. All cache settings are enabled in the XML configuration files unless indicated otherwise.

Table 2. . Repository cache settings
Name Setting and description Setting to add or update in the 100Custom.xml file

Branch context cache

branch-context-max-cache-size

This setting specifies the maximum number of branch contexts that are held in the Branch Manager cache, which contains metadata about the contents of snapshots in memory and is used to improve performance of certain operations. The default value is 64.

The setting is located in the applicable .00Static.xml files, but updates to the default value of the setting must be made by adding the setting to the 100Custom.xml files.

If your process applications are especially large and there are memory issues in the IBM BPM server, it may be necessary to reduce the value of the setting, particularly on runtime servers where a new branch is created for each deployed snapshot. Similarly, for a Process Server in a memory-constrained environment, reducing the Branch Manager cache size can reduce heap memory for large process applications. However, you may need to increase the value of the setting if the authored process application has a large number of dependencies on toolkits.

A toolkit with one business object takes less than 1 MB of memory for the branch cache entry and the snapshot cache. The IBM BPM Portal Process application uses about 11 MB of memory. The system data toolkit uses several hundred MB of memory. There is a difference in memory usage because of the complexity of the relationships between the artifacts in the project and the volume of artifacts in each project. Therefore, it is difficult to precisely predict the amount of additional memory that will be used when you are tuning the branch cache. To determine how to calculate approximate memory usage and learn more about this setting, see the IBM developerWorks article Tuning branch and snapshot cache sizes in IBM Business Process Manager.

To calculate the optimal value for speed at the expense of memory on a Process Server environment with multiple process applications deployed, one approach is to take a row count of table LSW_BRANCH in the database, multiply this number by 1.1, and then use the result as the value for the branch-context-max-cache-size setting. This approach assumes that all process applications are in relatively frequent use and that you want their contexts in memory. If a single process application is deployed, the optimal value is the number of dependencies of this process application plus one.
Note: Whenever a new process application or snapshot is deployed or deleted from the Process Server environment, you need to consider adapting the cache size.
<server>
   <repository>
     <branch-context-max-cache-size merge="replace">128
     </branch-context-max-cache-size>
   </repository>
</server>

Snapshot context cache

snapshot-cache-size-per-branch

This setting specifies the number of snapshots that are cached for a single branch in Process Center. The default value is 64.

In Process Server environments, you can retain the default value because this setting is ignored on Process Server. Each deployed snapshot is deployed to a unique branch on Process Server, which means that the snapshot cache contains only one entry.

The snapshot cache is tuned independently from the branch cache. Each branch cache entry contains a snapshot cache. In Process Center, all the snapshots on a branch use the same branch cache entry; therefore, the number of entries in the snapshot cache might be more than one. The number of entries that are needed depends on the number of snapshots that have been accessed. Snapshots are accessed when the snapshot is activated or when Process Designer users view artifacts, play back artifacts, or do both at a specific snapshot version. Therefore, tuning the snapshot cache size is necessary only for the Process Center server. The necessity to tune the snapshot cache is based on anticipated usage patterns.

Snapshot cache entries can be quite large because they depend on application content. It is not uncommon for snapshot cache entries to reach several hundred MBs. The size depends on the complexity and volume of the artifacts in a given snapshot.

The size of the snapshot cache is denoted as the number of snapshot cache entries that can be held in the cache. This is directly related to the number of unique process application and toolkit snapshots that are being accessed.

For very large projects and process applications, reducing the value of the snapshot-cache-size-per-branch setting can reduce heap memory requirements (but with a corresponding degradation of performance due to more frequent database usage). However, you may need to increase the value of the setting if the authored process application has a large number of dependencies on toolkits.

The setting is located in the applicable 00Static.xml files, but updates to the default value of the setting must be made by adding the setting to the 100Custom.xml files.

Additional information about this setting is found in the IBM developerWorks article Tuning branch and snapshot cache sizes in IBM Business Process Manager.

<server>
   <repository>
     <snapshot-cache-size-per-branch merge="replace">128
     </snapshot-cache-size-per-branch>
   </repository>
</server>