Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe
Top 5 Java Performance Metrics, Tips & Tricks
1. Top 5 Java Performance Metrics,
Tips & Tricks
Steven Haines, Java Expert and Author
2. Agenda
• Introduction
• Top 5 Performance Metrics to capture in Java
applications
• Business Transactions
• External Dependencies
• Caching Strategy
• Garbage Collection
• Application Topology
• Performance Monitoring Tips & Tricks
• Questions and Answers
3. About the Speakers
Steven Haines
• Author of two Java programming books and a
Java performance management book, over 500
articles, and a dozen white papers
• Former Java instructor at the University of
California, Irvine (UCI)
• Spent the better part of the last 6 years working
as an architect on Walt Disney World’s
MyMagic+ and other Disney initiatives
Anand Akela
• Director, Product Marketing, AppDynamics
4. Introduction
Why is performance so important?
• Cost to business
• Cost to reputation
• Sleepless nights…
Top 5 Performance Metrics to capture
• There are so many metrics and so many different
strategies to interpret them so how do we get the
biggest bang for our efforts?
• This presentation reviews strategies for identifying
performance issues in your application
6. #1 Business Transactions
• Business Transactions (BTs) capture real users
interacting with your application
• Capture requests from an entry-point
• Web request, Servlet, Struts Action, Spring MVC
Controller, message on a message queue, etc.
• Follow the request through the container
• Identify exit-points through which the request
goes to another container
• Web service call, RMI, JDBC, JMS, etc.
• Instrument every container and correlate BT
segments from each container into the holistic BT
8. Baselines
• Baselines: measure what “normal” is and
determine whether or not your business
transactions are behaving “normally”
• Baseline Types
• Response times over a period of time
• Response times based on hour of day
• Response times based on hour of day and day of week
• Response times based on hour of day and day of
month
10. #2 External Dependencies
• An external dependency is any system with
which your application interacts to accomplish its
business goal
• Web services, Databases (SQL and NoSQL), Legacy
Systems, Caches, Key/Value Stores, etc.
• Differentiate between applications problems and
dependency problems
• If your dependencies are not automatically
identified by your APM solution, configure them!
11. #3 Caching Strategy
• It is always faster to serve an object from
memory than it is to make a network call to
retrieve data from a dependent source
• IMHO, people that do not like caching are not
configuring them properly
• Two types of errors
• Loading too much data into your cache
• Not properly sizing the cache
13. #4 Garbage Collection
• Garbage collection has been and continues to be the
biggest component of poor JVM performance
• It removed the notion of manual memory management
and eliminated traditional memory leaks, but at the cost
of sometimes cumbersome garbage collection processes
• Different JVMs have different strategies that each
introduce their own set of benefits and challenges
• Understanding how garbage collection works will help you tune it
• For this discussion we’ll review the Sun JVM
16. #5 Application Topology
• With the advent of the cloud, applications can
now be elastic in nature: your application
environment can grow and shrink to meet your
user demand
• Take inventory of your servers and ensure that
your environment is sized optimally
• Too many servers means a higher cloud cost and
wasted resources
• Too few servers means that servers will be
overburdened and your business transactions will
suffer
18. Business Transaction Optimization
• It is important to capture the business
transactions that are important to you
• Properly name BTs to match your business processes
• Filter out the BTs that are not important
• Capture BTs properly
• Default behavior may not match your business needs
• If your URLs are complex then tell AppDynamics how
to interpret them
• If you have a central controller that differentiates
functionality by payload then configure it as such
• Etc.
19. Snapshot Tuning
• Snapshots are invaluable in helping you identify the root
cause of your performance problems; they give you a
trace through your entire business transaction with
associated response times
• Default snapshot configuration samples threads every
10ms
• If you do not need this level of granularity then increasing the
interval will reduce overhead at the cost of granularity
• Slow transactions are configured to capture up to 5
samples per minute for 5 minutes
• If you typically only examine two or three snapshots then turn this
down
20. Threshold Tuning
• Thresholds control when alerts are raised and
when snapshots are triggered
• Three types of thresholds:
• Static SLA
• Standard Deviation
• Percentage
• Choose and configure the strategy that meets
your business needs
21. Tier Management
• AppDynamics measures and evaluates
performance at the business transaction level as
well as at the segment level
• Segments are defined by the tiers that
implement them and are transitioned via exit-
points
• Standard protocols are available out-of-the-box
• If you have non-standard communication
protocols then you need to tell AppDynamics
when your code is leaving a tier
22. Context…
• Many times, when performance issues occur,
contextual information can provide you with
much needed debug content
• AppDynamics allows you to capture
• HTTP Headers
• JMS Properties
• HTTP Query Parameters
• Method Parameter Values
23. Intelligent Container Recycling
• As applications are moving to the cloud, your
infrastructure is changing
• Smart deployment strategies allow you add
servers to and remove servers from your
environment to meet user demand
• Cycle your virtual machines or containers
intelligently
• Shutdown your oldest machines first so that virtual
machines have short lives
• Anecdotal example: eliminating garbage collection
through smart recycling!
24. Summary
• Performance is a measurable concern
• We reviewed 5 metrics to capture to help us identify
performance problems
• We reviewed tips-and-tricks for configuring
AppDynamics for optimal performance troubleshooting
http://blog.appdynamics.com/java/top-5-java-performance-metrics-to-capture-
in-enterprise-applications/
25. Today’s Monitoring: Many Silo-ed Tools
33%
issues are reported by
end users
77%
issues require 5+ people-
hour to resolve
* Survey response from 302 IT
professionals conducted by EMA
65%
enterprises have 10+
monitoring tools.
0%
1%
13%
21%
22%
15%
9%
6%
3%
10%
0% 5% 10% 15% 20% 25%
0
1
2-5
6-10
11-25
26-40
41-50
50-75
76-100
More than 100
Q: how many enterprise monitoring/mgmt products would you estimate your IT org owns?*
29. Join us in Vegas for our annual user conference,
AppSphere!
- Free training for all attendees
- Exclusive access to AppDynamics executives and engineers
- A sneak peek at our roadmap and announcements about new features
- Keynotes from industry innovators
- Information-packed breakout sessions from users in the trenches
- Peer-to-peer networking
Learn more and register now at Appdynamics.com/AppSphere