close

Filter

loading table of contents...

Content Application Developer Manual / Version 2512.0

Table Of Contents

3.2 Performance Analysis and Optimization

Analyzing and optimizing CAE performance should be performed each time a new or overhauled site is launched or an upgrade to a newer CoreMedia CMS release is applied.

Metrics-Based Analysis

Set up monitoring for the metrics exposed via the actuator endpoint /actuator/prometheus. Key metrics to monitor include:

  • Request response times: Identify slow individual requests as well as frequently repeated requests that accumulate noticeable latency. Use Spring Boot's HTTP server request metrics (e.g. http_server_requests_seconds).

  • JVM memory and GC: Monitor jvm_memory_used_bytes and jvm_gc_overhead. Excessive GC activity is a major cause of performance degradation. Balance heap size against cache capacity — do not configure the heap larger than the available system memory allows.

  • Cache evictions: A high eviction rate (coremedia_cache_evictions_total) relative to cache reads (coremedia_cache_gets_total) in any cache class is a red flag indicating that the cache capacity is too small for the working set. See Section 3.3.2, “In-memory Caching (CacheKey Cache)” for details on tuning cache capacities.

Thread Dumps for Hot-Spot Identification

If slow requests are observed, capture thread dumps (e.g. via jstack or the /actuator/threaddump endpoint). Thread dumps reveal where threads spend their time and are also the first artifact CoreMedia Support will request when a support ticket is opened.

Garbage Collection Tuning

Garbage Collection has a major impact on CAE performance. Monitor jvm_gc_overhead and GC pause metrics. Keep the configured maximum heap size within the physical memory available to the container. When increasing cache capacities, verify that the JVM still has sufficient headroom for GC to operate efficiently.

CacheKey Cache Tuning

The com.coremedia.cache.Cache partitions cached values into cache classes. If no dedicated cache class is configured for a cache key, values fall into the java.lang.Object default class. Dataview cache entries similarly use the configured content bean class as their cache class when a capacity is defined for that class — otherwise they fall into AssumesIdentity or ultimately java.lang.Object.

Inspect the actuator endpoint /actuator/cache/java.lang.Object?keys=true to discover which cache key types currently reside in the default class. Introducing dedicated cache classes by configuring capacities (e.g. cache.capacities.com.mycompany.MyCacheKey=5000) gives fine-grained control over eviction and heap consumption. See Section 3.3.2, “In-memory Caching (CacheKey Cache)” for details.

Image Transformation

Image transformation is a known CPU- and memory-intensive operation. Large input images amplify this effect. The ThrottlingBlobTransformer limits concurrent transformations via a semaphore-based permit system to prevent heap exhaustion. Key configuration properties (prefix com.coremedia.transform.throttle):

  • permits — total permits for concurrent transformations (default: max heap / 4, expressed in MB). Increase to allow more parallelism at the cost of higher memory usage.

  • hardLimit — when true (default), requests exceeding permits are rejected rather than queued.

  • safetyFactor — multiplier for estimating image memory consumption (default: 3.0).

Related cache classes to monitor are com.coremedia.transform.image.java2d.LoadedImageCacheKey and com.coremedia.transform.impl.TransformedBlobKey. Enable the persistent file system blob cache (com.coremedia.transform.blobCache.basePath) to avoid costly re-transformations after restarts. For high-volume image processing, consider using the CoreMedia Image Transformation Service.

General Advice

Performance tuning is an iterative process. Set your performance requirements and work towards them by balancing CDN caching, content freshness, and resource allocation. Rely on reproducible load tests with production-like content and request patterns. Remember Donald Knuth's advice: "Premature optimization is the root of all evil" — let metrics guide your optimization efforts. If in doubt, consider engaging CoreMedia Professional Services for expert assistance.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

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