Tuesday 4 June 2019

AEM Site Performance Issues - Root Cause - Analysis - How to Fix

When we say the AEM site performance is hit?

Once the production deployment of an AEM site is done, and if we find slowness in any of the things like pages are loading slow, creation or editing of pages are slow, AEM response times are not fair, AEM is not responding to some requests,  request.log on AEM shows slow response times etc. we can assume there is some issue with the performance of the site.

Common reasons for slow performance

Below given some of the possible reasons for AEM site performance issues;
  • Improper design - Not a deeply though solution
  • High CPU utilization due to long running requests such as slow searches, write-heavy background jobs, moving the whole branches of site content, etc.
  • Application code - Error prone code
  • Memory Issues - Not an efficiently written
  • Insufficient server sizing or incorrect architecture - For a huge site, we did not use mult author multi pubish setup
  • Indexing Issues - Not done a proper indexing
  • Lack of caching - No efficient caching
  • Wrong disk I/O configuration - Improper infra configuration
  • Memory sizing - Not used enough memory
  • Network bandwidth and latency - Not having proper bandwidth allocated
  • Replication Issues - Improper configuration which leads to blockage
  • Ineffective or inadequate maintenance
  • Lack of a Content Delivery Network

How do we analyze the root cause of a performance issue?
  • Check CPU utilization for any AEM process eating much memory
  • Study the request.log file for detailed data
  • Collect thread dumps and analyze them
  • Workflow checks, version checks, audit checks
  • Analyze caching strategies implemented at the AEM dispatcher
  • Check maintenance related to Oak repositories
  • Validate asset guidelines
  • Check indexing and review the jcr queries for 1. Poorly restricted (or scoped) queries 2. Large result set queries 3. Index-less queries

Some of the Tools for validating and fixing AEM performance:

  • JMX Console in AEM : Enables you to monitor and manage services on the CRX server.
  • JConsole : that comes with JDK - helps to find memory leaks, thread deadlock etc.
  • Any other profilers : like YourKit(CPU and memory profiling tool) which recommends the better usage of code
  • Memory analyzer tool - MAT :  Eclipse's MAT is a set of plug-ins for the Eclipse IDE. Helps for heap dump analysis & memory problems in the application
  • Apache Bench : Helps to identify memory leaks, selectively analyze response time.
  • JMeter : Load and functional tests.
  • JProfiler : In-depth CPU and memory profiling.
  • SonarQube : A code validation tool for better code

How to make sites perform better?
  • Ensure you are carrying out regular maintenance
  • Improve back-end service calls to a fail safe state.
  • Optimize AEM client libraries - Embed client libraries, Minify them
  • Cache JavaScript and CSS for long periods of time
  • Optimize Indexes so that querying works better
  • Modify the jcr queries to scope limited and efficient.
  • Install the recommended AEM service packs, cumulative fix packs and hot fixes:
  • Follow the Assets best practices.
  • Allocate enough RAM to avoid IO saturation
  • Enable transient workflows - this avoids manual purging of workflows
  • Tune the Oak Repository as per best practice

Hold on; Before you go for any big changes as part of performance improvements, have a backup plan, Disaster recovery plan do itfirst before you try to fix the performance.

More Like This:

AEM 6.5 Site related new features

AEM 6.5 Specific new features in Assets section

New Features in AEM 6.5 Forms

Foundation updates in AEM 6.5 which a developer should be aware of

Cloud Manager for AEM 6.5 New features

Storage concepts in AEM 6.5   

HTML Template language updates which needs to be observed with AEM 6.5

No comments:

Post a Comment