AEM_Tools for Monitoring and Analyzing Performance


The following gives a short overview of some of the tools available for monitoring and analyzing performance.
Some of these will be dependent on your operating system.
ToolUsed to analyze...Usage / More information...
request.logResponse times and concurrency.Inter request.log.preting the
truss/stracePage Loads
Unix/Linux commands to trace system calls and signals. Increase the log level to INFO.
Analyze the number of page loads per request, which pages, etc.
Thread dumpsObserve JVM threads. Identify contentions, locks and long-runners.
Dependent on the operating system:
- Unix/Linux: kill -QUIT <pid>
- Windows (console mode): Ctrl-Break
Analysis tools are also available, such as TDA.
Heap DumpsOut of Memory issues that cause slow performance.
Add the:
    -XX:+HeapDumpOnOutOfMemoryError
option to the java call to CQ.
System callsIdentify timing issues.
Calls to System.currentTimeMillis() or com.day.util.Timing are used to generate timestamps from your code, or via HTML-comments.
Note: These should be implemented so that they can be activated / deactivated as required; when a system is running smoothly the overhead of collecting statistics will not be needed.
Apache BenchIdentify memory leaks, selectively analyze response time.
basic usage is:
ab -k -n <requests> -c <concurrency> <url>
See Apache Bench and the ab man page for full details.
Search Analysis Execute search queries offline, identify response time of query, test and confirm result set.
JMeterLoad and functional tests.http://jakarta.apache.org/jmeter/
JProfilerIn-depth CPU and memory profiling.http://www.ej-technologies.com/
JConsoleObserve JVM metrics and threads.
Usage: jconsole
Note: With JDK 1.6, JConsole is extensible with plug-ins; for example, Top or TDA (Thread Dump Analyzer).
Java VisualVMObserve JVM metrics, threads, memory and profiling.
Usage: jvisualvm or visualvm
Note: With JDK 1.6, VisualVM is extensible with plug-ins.
truss/strace, lsofIn depth kernel call and process analysis (Unix).Unix/Linux commands.
Timing StatisticsSee timing statistics for page rendering.
To see timing statistics for page rendering you can use Ctrl-Shift-U together with ?debugClientLibs=true set in the URL.
CPU and memory profiling toolUsed when analyzing slow requests during development.For example, YourKit.
Information CollectionThe ongoing state of your installation.Knowing as much as possible about your installation can also help you track down what might have caused a change in performance, and whether these changes are justified. These metrics need to be collected at regular intervals so you can easily see significant changes.

AEM_How to monitor Replication agents


You can monitor your replication queues to detect when a queue is either down or blocked
  • all enabled queues should have the status idle or active, which indicate normal operation; 
  • No queues should be blocked, which is often a sign of problems on the receivers side.
  • if the size of the queue grows over time this can indicate a blocked queue.
To monitor a replication agent:
  1. a. Access the Tools tab in AEM.
  2. B. Click Replication.
  3. C. Double-click the link to agents for the appropriate environment (either the left or the right pane); for example Agents on author.
    The resulting window shows an overview of all your replication agents for the author environment, including their target and status.
  4. chlimage_1
    Here you can:
    • See whether the agent is enabled.
    • See the target of any replications.
    • See whether the replication queue is currently active (enabled).
    • See whether there are any items in the queue.
    • Refresh or Clear to update the display of queue entries; this helps you see items enter and leave the queue.
    • View Log to access the log of any actions by the replication agent.
    • Test Connection to the target instance.
    • Force Retry on any queue items if required.

Caution:
Do not use the "Test Connection" link for the Reverse Replication Outbox on a publish instance.
If a replication test is performed for an Outbox queue, any items that are older than the test replication will be re-processed with every reverse replication.
If such items already exist in a queue, they can be found with the following XPath JCR query and should be removed.
/jcr:root/var/replication/outbox//*[@cq:repActionType='TEST'] 

AEM_Types of Audit log

  1. 1. AEM WCM Audit records:
  • Audit records are held to provide a record of who did what and when.
  • Open a page.
  • From the sidekick you can select the tab with the lock icon, then double-click on Audit Log...
  • A new window will open showing the list of audit records for the current page.
    • Click OK when you want to close the window.

    2. AEM WCM Auditing records within the repository

    • Within the /var/audit folder, audit records are held according to the resource. 
    • You can drill down until you can see the individual records and the information they contain.
    • These entries hold the same information as shown when editing a page.

    3. OSGi Audit records from the Web Console

    • OSGi events also generate audit records which can be seen from the Configuration Status tab -> Log Files tab in the Adobe CQ Web Console: