Configuring the XPath cache

The integration server XPath cache size might become a performance bottleneck for customers who use many XPath expressions. Altering the size of the XPath cache might improve message flow performance.

An integration server (or 'execution group' in WebSphere® Message Broker Version 8.0 and earlier versions) keeps a cache of compiled XPath expressions to help reduce the processor usage of parsing and re-creating XPath expressions that are used repeatedly during message flow execution. This cache is shared by all message flows within an integration server. The default size of this cache is 10000 elements, and this is expected to be sufficient for most customer configurations.

It might be necessary to alter the size of this cache for optimal message flow performance if hundreds or thousands of XPath expressions are created for each Message Flow invocation. In a highly multi-threaded environment where many XPath expressions are evaluated on each message flow invocation, it might be necessary to disable the cache to remove thread contention on the cache. From IBM® Integration Bus Version 10.0 onwards, the XPath cache has its own resource manager ComIbmXPathCache; run the following command to return the status:
mqsireportproperties <INode> -e default -o ComIbmXPathCache -r
where <INode> is your integration node. The following output is an example of that returned from the command:
ComIbmXPathCache
 uuid='ComIbmXPathCache'
 userTraceLevel=''
 traceLevel=''
 userTraceFilter=''
 traceFilter=''
 vrmfIntroducedAt=''
 resourceGroup=''
 mode='enabled'
 maximumSize='10000'
 minimumSize='6000'
 currentSize='0'
 entryWarningThreshold='1000'
The maximumSize property controls the maximum number of compiled XPath expressions that can be stored in the XPath cache. When the XPath cache reaches this limit of compiled XPath expressions, entries are evicted from the cache based on the following criteria:
  • How often they were used.
  • When they were last used.
You can change the value of the maximumSize property with the following command:
mqsichangeproperties <INode> -e default -o ComIbmXPathCache -n maximumSize -v 20000
The minimumSize property controls the minimum number of compiled XPath expressions that can be stored in the XPath cache. When the XPath cache reaches this number of compiled XPath expressions, the number of entries does not fall any lower when entries are evicted from the cache. You can change the value of the minimumSize property with the following command:
mqsichangeproperties <INode> -e default -o ComIbmXPathCache -n minimumSize -v 1000

The currentSize property reports the number of compiled XPath expressions that are stored in the XPath cache. This property is read-only, and must not be set with the mqsichangeproperties command.

The mode property controls whether the cache is enabled or disabled. When the cache is disabled, no XPath expressions are cached. This can improve performance in highly multi-threaded environments where each message flow invocation creates unique XPath expressions, which are only used once. To disable the cache, set the mode property to disabled. You can change the value of the mode property with the following command:
mqsichangeproperties <INode> -e default -o ComIbmXPathCache -n mode -v disabled
The entryWarningThreshold property controls how frequently activity log messages are emitted by the XPath cache as it grows in size. The XPath cache emits an activity log message that gives updates about the size of the cache whenever the size of the cache divided by the value of entryWarningThreshold equals 0. The default value of the entryWarningThreshold property is 1000 and is ten per cent of the default maximum size of the cache. The cache also emits an activity log message when the cache reaches the maximum size and a cache flush occurs. If the value of the maximumSize property is changed, the value of the entryWarningThreshold property might also need to be changed. You can change the value of the entryWarningThreshold property with the following command:
mqsichangeproperties <INode> -e default -o ComIbmXPathCache -n entryWarningThreshold -v 20