This page discusses how to get the best performance from Java Agents. You can view performance statistics for deployed app agents in the diagnostic data window.

Viewing Agent Diagnostic Data

The agent diagnostic data shows you information about the performance of App Server agents. You can view the data from the Agents page in the Controller UI.

From the Node Dashboard of the node that contains the agent you want to view, click the Agent Diagnostic Stats sub tab. Click View Diagnostics for all Agents to see stats for all agents.

Business Transaction Thresholds

AppDynamics determines whether transactions are slow, very slow, or stalled based on the thresholds for Business Transactions. AppDynamics recommends using standard deviation based dynamic thresholds. See Transaction Thresholds.

Snapshot Collection Thresholds

Snapshot collection thresholds determine when snapshots are collected for a Business Transaction. Too many snapshots can affect performance and therefore snapshot collection thresholds should be considered carefully in production or load testing scenarios. See Transaction Thresholds.

Suggested Scheduling Settings

  • 10 minutes for deployments with less than 10 BTs
  • 20 minutes for deployments from 10 to 50 BTs
  • 30 minutes for deployments from 50 to 100 BTs
  • 60 minutes for deployments larger than 100 BTs

Suggested Diagnostic Session Settings

  • Settings for Slow requests (%value): 20–30
  • Settings for Error requests (%value): 1020
  • Click Apply to all Business Transactions.

Tuning Call Graph Settings

You can tune call graph settings from the Call Graph Settings page, as described in Call Graph Settings.

Suggested SQL Query Time and Parameters

  • Increase the Minimum SQL query time to 100 ms from the default of 10 ms.
  • Enable Filter SQL Parameter Values.

Memory Monitoring

Memory monitoring features such as leak detection, object instance tracking, and custom memory should be enabled only for a specific node or nodes when debugging a memory problem. Automatic leak detection is on-demand, and therefore, the leak detection will execute only for the specified duration.

When you observe periods of growth in the heap utilization (%), you should enable on-demand memory leak capture. See Java Memory Leaks.

Agent Heap Storage Monitoring and Shutdown

The Java Agent monitors the heap storage used by the instrumented application and shuts itself down when conditions indicate excessive utilization of Java heap storage by the application. The agent takes this measure not necessarily because it is likely to be the source of the memory pressure—in fact, it can help you diagnose the root cause of the issue—but as a final protective measure to help relieve the pressure on available memory for the application.

Typical reasons for excessive heap utilization include: 

  • Java heap space is too small compared to your application traffic and footprint
  • Java heap memory leak
  • A rogue thread is consuming a large amount of memory in a short amount of time

Java Agent monitoring of heap storage works as follows. The agent check heap utilization every 30 seconds. When it detects that heap utilization has exceeded 95%, the Java Agent checks for a garbage collection event. When garbage collection occurs, it checks heap utilization again. If usage still exceeds the threshold, the agent shuts itself down and logs the following agent event:  

ERROR HeapShortageMonitor - Agent shutdown triggered because max heap usage percentage reached 

If heap memory utilization exceeds the threshold, but garbage collection never occurs, the agent resumes normal monitoring after 30 seconds. If the heap usage remains above the threshold, the heap shortage monitor resumes checking for garbage collection, as it did previously. 

You can use a Java Agent node property to control whether heap storage monitoring is enabled and the action that results from excessive heap utilization. The heap-storage-monitor-enabled controls whether it is enabled (true, by default), and the heap-storage-monitor-shutdown-action property determines the triggered action, between:

  • true: If the heap threshold is exceeded, the agent is disabled.
  • false: If the threshold is exceeded, a warning-level message is written to the agent log and warning event is sent to the Controller (of type AGENT_EVENT with the text: "AppDynamics agent has detected shortage of JVM Heap Storage").