top 5 java performance metrics, tips & tricks

32
Top 5 Java Performance Metrics, Tips & Tricks teven Haines, Java Expert and Author

Upload: appdynamics

Post on 13-Aug-2015

116 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Top 5 Java Performance Metrics, Tips & Tricks

Top 5 Java Performance Metrics, Tips & Tricks

Steven Haines, Java Expert and Author

Page 2: Top 5 Java Performance Metrics, Tips & Tricks

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

Page 3: Top 5 Java Performance Metrics, Tips & Tricks

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

Page 4: Top 5 Java Performance Metrics, Tips & Tricks

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

Page 5: Top 5 Java Performance Metrics, Tips & Tricks

Top 5 performance metrics to capture

Page 6: Top 5 Java Performance Metrics, Tips & Tricks

#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

Page 7: Top 5 Java Performance Metrics, Tips & Tricks

Business Transactions

Page 8: Top 5 Java Performance Metrics, Tips & Tricks

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

Page 9: Top 5 Java Performance Metrics, Tips & Tricks

Baseline Alerts

Page 10: Top 5 Java Performance Metrics, Tips & Tricks

#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!

Page 11: Top 5 Java Performance Metrics, Tips & Tricks

#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

Page 12: Top 5 Java Performance Metrics, Tips & Tricks

Cache Thrashing

Page 13: Top 5 Java Performance Metrics, Tips & Tricks

#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

Page 14: Top 5 Java Performance Metrics, Tips & Tricks

Reachability Test

Page 15: Top 5 Java Performance Metrics, Tips & Tricks

Minor and Major GCs

Minor Collection Major Collection

Page 16: Top 5 Java Performance Metrics, Tips & Tricks

#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

Page 17: Top 5 Java Performance Metrics, Tips & Tricks

Performance Monitoring Tips & Tricks

Page 18: Top 5 Java Performance Metrics, Tips & Tricks

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.

Page 19: Top 5 Java Performance Metrics, Tips & Tricks

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

Page 20: Top 5 Java Performance Metrics, Tips & Tricks

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

Page 21: Top 5 Java Performance Metrics, Tips & Tricks

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

Page 22: Top 5 Java Performance Metrics, Tips & Tricks

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

Page 23: Top 5 Java Performance Metrics, Tips & Tricks

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!

Page 24: Top 5 Java Performance Metrics, Tips & Tricks

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/

Page 25: Top 5 Java Performance Metrics, Tips & Tricks

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

2-5

6-10

11-25

26-40

41-50

50-75

76-100

More than 100

0% 5% 10% 15% 20% 25%

0%

1%

13%

21%

22%

15%

9%

6%

3%

10%

Q: how many enterprise monitoring/mgmt products would you estimate your IT org owns?*

Page 26: Top 5 Java Performance Metrics, Tips & Tricks

26

AppDynamics Unified MonitoringOne Solution : One UI, One Data Platform, One Install

Copyright © 2014 AppDynamics. All rights reserved.

Industry-first application-centric Unified monitoring platform

Page 27: Top 5 Java Performance Metrics, Tips & Tricks

Copyright © 2015 AppDynamics. All rights reserved. 27

Business transaction-centric management

Role-relevant views for quick troubleshooting

One Unified Platform - Easy to deploy and Use, Flexible Deployment

Comprehensive Application Infrastructure Support

Key Focus Areas of Unified Monitoring

Page 28: Top 5 Java Performance Metrics, Tips & Tricks

28

AppDynamics Unified Monitoring Pays off for Paychex

Copyright © 2014 AppDynamics. All rights reserved.

Challenges Benefits

Why AppDynamics?

• Tool consolidation – replaced 5 tools with AppDynamics

• Improved capacity-planning capabilities

• Increased troubleshooting efficiency and staff prioritization

• Too many monitoring tools and many of them didn’t meet expectations

• Lack of deep visibility into the application infrastructure

• Existing monitoring tools couldn’t support the continuous delivery model with 3 code releases per week

• Quickly drill down into performance data to troubleshoot issues

• Integration with enterprise logging and management tools• Exceptional training and technical support

“AppDynamics replaced 5 tools we once used to try to troubleshoot application problems. Today, everyone goes to AppDynamics to quickly determine the root cause of the issue.” - Jason Briggs, Monitoring Engineering Manager, Paychex

https://www.appdynamics.com/case-study/paychex/

Page 29: Top 5 Java Performance Metrics, Tips & Tricks

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

Page 30: Top 5 Java Performance Metrics, Tips & Tricks

Q&A

Page 31: Top 5 Java Performance Metrics, Tips & Tricks

Copyright © 2014 AppDynamics. All rights reserved. 31

Sign-up for your Free Trial today!

Page 32: Top 5 Java Performance Metrics, Tips & Tricks

Thank You