Develop > Developer Reference > Using APIs > Universal CMDB API > Performance Improvement with a Bidirectional GlobalID - UcmdbID Mapping Cache

Performance Improvement with a Bidirectional GlobalID - UcmdbID Mapping Cache

In version 10.33, the implementation of a bidirectional GlobalID - UcmdbID mapping cache at the uppermost level enables faster retrieval of Global IDs by Ucmdb ID and vice-versa. For example, before executing a query to retrieve the UCMDB ID for a global ID, the entry is searched in the bidirectional cache first, and if there is a match, the value will be retrieved directly from the mapping cache.

Usage

The mapping cache works as is, by default, no special care is required from the users. However, there are 3 new UCMDB settings which allow you to customize the cache's configuration (by invoking the setGlobalSettingValue JMX method from the UCMDB:service=Settings Services category):

  • cache.globalucmdbid.maxsize - Specify the maximum size of the cache, in number of entries; default value 1000.
  • cache.globalucmdbid.timeout.active - Specify the time, in seconds, after which an entry will be removed from the cache (regardless of whether it was used or not); default value 1200 (20 minutes).

  • cache.globalucmdbid.timeout.idle - Specify the time, in seconds, after which an entry will e removed from the cache if not used in the meantime; default value 300 (5 minutes).

Therefore, cache entries will be evicted after a time as specified in the above settings. If the cache fills, there is a Least Frequently Used (LFU) eviction policy.

The cache is added in the API-server layer of the SDK, so it only has effect for the SDK methods of conversion from global ID to UCMDB ID, that is, MultipleCMDBService.

The following is an example of using one of the methods in the MultipleCMDBService:

//connect to the ucmdbService
MultipleCMDBService multipleCMDBService = ucmdbService.getMultipleCMDBService();
GlobalIds globalIds = multipleCMDBService.getFactory().createGlobalIds(1);
globalIds.add(globalId);
GlobalIdToIdMapping globalIdToIdMapping = multipleCMDBService.convertGlobalIdsToIds(globalIds);
System.out.println("UcmdbId: " + globalIdToIdMapping.getID(globalId));

Performance Improvement

Compared to version 10.32, performance evaluation for the mapping cache shows an improvement of performance between 15% - 78% (depending on scenarios) over the same operations without the cache.

Scenario Performance Improvement
Conversion from Global_Id to Ucmdb_Id for a single CI

45% increase in performance

Conversion from Global_Id to Ucmdb_Id for a bulk of CIs (840)

78% increase in performance

Conversion from Ucmdb_Id to Global_Id for a bulk of CIs (840)

15% increase in performance

There is also an 18% increase in the average number of successfully completed requests.