close

Filter

loading table of contents...

Release Notes / Version 12.2406.4

Table Of Contents

Optimization of Cache Class Configuration

CoreMedia Cache Keys that are not specified for a dedicated cache class are stored in default cache class java.lang.Object. This could

  • lead to unwanted eviction of cache keys as the individual key types cannot be weighted against each other, and could also

  • make it difficult to size Java heap memory correctly as the real memory consumption of keys may differ widely.

With a revised assignment of cache keys to classes, dynamic cache class lookup by key type, and introduction of heap memory consumption estimation for some cache keys, it is know possible to optimize cache behavior by making it more predictable. This requires reviewing and maybe adjusting some of your project’s existing cache class settings.

Upgrade information

If no specific cache class is defined via CacheKey#cacheClass(Cache, T), lookup of a cache class for the cache key is now done by traversing the type hierarchy against the configured capacities of a cache. See Java documentation for com.coremedia.cache.CacheKey#cacheClass(Cache, T) and com.coremedia.cache.Cache#cacheClassFor(Class<?>). This mechanism may be relevant for you to pull cache keys predefined by the product or defined in your project from default cache class java.lang.Object into a dedicated cache class. See last section in this upgrade information for predefined cache keys that may be subject to this step. You can use actuator endpoint http://<host>:<management-port>/actuator/cache/java.lang.Object?keys=true to get information about cache keys that are currently stored in the default cache class.

As the cache class assignments for some cache keys have changed, it is strongly recommended to check your project’s individual cache capacity settings when upgrading by comparing eviction rates of the current system with the upgraded system. Preferably, use a load test which processes the majority of your sites' data. Check for eviction rates in cache classes com.coremedia.cap.heap and contenthub.object (if a ContentHub Adapter is active in your system). Neither should be increased. Also check for changes in Java heap memory consumption and GC timings. Neither should be increased. Adjust cache capacity for com.coremedia.cap.heap, contenthub.object, and/or Java maximum heap accordingly. Ideally, use a monitoring tool to gain insights. Alternatively, you can retrieve the information via actuator endpoint /actuator/prometheus. The following entries in the delivered metrics are relevant for an investigation:

  • {{coremedia_cache_evictions_total {class="contenthub.object"}

    }}: number of evictions in cache class contenthub.object

  • {{coremedia_cache_evictions_total {class="com.coremedia.cap.heap"}}}: number of evictions in cache class com.coremedia.cap.heap
    * {{coremedia_cache_level{class="com.coremedia.cap.heap"}

    :}} estimated memory consumption of elements in cache class com.coremedia.cap.heap

  • jvm_gc_overhead: approximation of the percent of CPU time used by GC activities

  • {{jvm_memory_used_bytes {area="heap",id="*"}

    }}: amount of used Java heap memory (replace * for different heap spaces)

The following cache keys have been equipped with memory size estimations and are now stored in cache class “com.coremedia.cap.heap“:

  • com.coremedia.blueprint.base.caas.p13n.adapter.PersonalizationRuleCacheKey

  • com.coremedia.blueprint.base.links.VanityUrlMapperCacheKey

  • com.coremedia.blueprint.base.multisite.cae.SiteBySegmentCacheKey

  • com.coremedia.blueprint.base.navigation.context.finder.impl.FolderPropertiesLookupCachekey

  • com.coremedia.blueprint.base.pagegrid.impl.PageGridCacheKey

  • com.coremedia.blueprint.base.settings.impl.LocalAndLinkedSettingsFinder

  • com.coremedia.cap.transform.TransformationsCacheKey

  • com.coremedia.blueprint.coderesources.CodeResourcesCacheKey

  • com.coremedia.blueprint.cae.contentbeans.CMChannelImpl

  • com.coremedia.feedbackhub.BindingsCacheKey

  • com.coremedia.blueprint.taxonomies.strategy.TaxonomyStrategiesCacheKey

  • com.coremedia.blueprint.cae.web.i18n.LinklistPageResourceBundleFactory

  • com.coremedia.objectserver.dataviews.codegen.CodeGeneratingDataViewFactory$ImplicitDataViewDefinitionCacheKey

  • com.coremedia.caas.media.impl.ResponsiveMediaHashCacheKey

The following cache keys have been moved to dedicated cache classes. As they don’t vary noticeably in memory size they don’t require a memory estimation:

  • com.coremedia.blueprint.base.settings.impl.SiteSettingsFinder$SiteSettingsCacheKey (moved to cache class com.coremedia.cap.unlimited as there is only one cache key of this type per site)

  • com.coremedia.blueprint.base.links.impl.AbsoluteUrlPrefixRuleProvider$SingletonRulesCacheKey (moved to cache class com.coremedia.cap.unlimited as there is only a single instance of this cache key)

  • com.coremedia.blueprint.localization.TaxonomyLocalizationSettingsCacheKey (moved to cache class com.coremedia.cap.unlimited as there is only a single instance of this cache key)

  • com.coremedia.blueprint.cae.handlers.ContentRootNavigationsBySegmentCacheKey (moved to cache class com.coremedia.cap.unlimited as there is only a single instance of this cache key)

  • com.coremedia.rest.cap.upload.UploadConfigurationCacheKey (moved to cache class com.coremedia.cap.unlimited as there is only one cache key of this type per site)

  • com.coremedia.contenthub.lib.AdapterBindingsProvider$AdapterBindingCacheKey (moved to existing cache class contenthub.object)

This leaves the following cache keys without dedicated cache classes. Without further configuration, they are stored in cache class java.lang.Object:

  • com.coremedia.blueprint.base.elastic.social.mail.MailTemplateByNameLocaleTenantCacheKey

  • com.coremedia.blueprint.base.elastic.social.mail.MailTemplatesByNameCacheKey

  • com.coremedia.amaro.persistentcache.proactive.ProactiveEngine$TransientToPersistentCacheKey

  • com.coremedia.blueprint.personalization.include.P13NDynamicContainerCacheKey

  • com.coremedia.blueprint.personalization.variant.P13NVariantConditionPredicate$ConditionsProcessorCacheKey

  • com.coremedia.blueprint.cae.view.resolver.ThemeTemplateViewRepositoryProvider$TemplateLocationsCacheKey

  • com.coremedia.blueprint.cae.view.resolver.ThemeTemplateViewRepositoryProvider$ViewRepositoryNamesCacheKey

  • com.coremedia.blueprint.base.sfmc.libservices.authentication.AuthenticationCacheKey

  • com.coremedia.blueprint.base.sfmc.libservices.contentbuilder.GetCategoryCacheKey

  • com.coremedia.blueprint.base.sfmc.libservices.contentbuilder.GetRootCategoryCacheKey

Those cache keys may be put into dedicated cache classes by configuring a cache size for each (see Java documentation for com.coremedia.cache.CacheKey#cacheClass(Cache, T) and com.coremedia.cache.Cache#cacheClassFor(Class<?>)). Example: if a dedicated cache class shall be defined for cache key com.coremedia.blueprint.cae.view.resolver.ThemeTemplateViewRepositoryProvider$TemplateLocationsCacheKey, add the following line (with appropriate capacity for your project) to the Spring configuration of your CAEs:

cache.capacities.com.coremedia.blueprint.cae.view.resolver.ThemeTemplateViewRepositoryProvider.TemplateLocationsCacheKey=100

However, it is not recommended to move the before-mentioned predefined cache keys from cache class java.lang.Object into a dedicated cache class unless a high eviction rate is observed and the cache capacity cannot be increased. For project-specific cache keys, an estimation of memory size may prove helpful if Java heap consumption by those cache keys is high or varying widely.

(CMS-27132)

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.