33
Zing Vision Answering your toughest production Java performance questions

Webinar: Zing Vision: Answering your toughest production Java performance questions

Embed Size (px)

DESCRIPTION

Solving Java performance issues in production can be frustrating. You’re left in the dark about what could be causing the problems because standard Java tools have too much performance overhead for production use. They’re designed for development or pre-production testing and realistically can’t be used to monitor a business-critical application during peak loads, which is when the problems occur! Zing Vision is your flashlight. Its low overhead metric collection is built into Zing, Azul’s high performance virtual machine, and designed to run in production with zero performance overhead. At last, you can see your applications’ operation at the thread level, track memory usage, find “hot” code and even save data for later analysis. In this webinar, Joseph Coha, Azul Systems Senior Staff Engineer, describes how Zing Vision works, shows sample data and discusses how you can use this information to find and fix your most stubborn production performance issues. He also tells you how you can download and try Zing and Zing Vision with your current applications to see for yourself how far you can take the performance of your existing apps.

Citation preview

Page 1: Webinar: Zing Vision: Answering your toughest production Java performance questions

Zing Vision Answering your toughest production

Java performance questions

Page 2: Webinar: Zing Vision: Answering your toughest production Java performance questions

Outline

• What is Zing Vision?

• Where does Zing Vision fit in your Java environment?

• Key features

• How it works

• Using ZVRobot

• Q & A

©2014 Azul Systems Inc. 2

Page 3: Webinar: Zing Vision: Answering your toughest production Java performance questions

What is Zing Vision?

• Zing Vision is a browser-based, visual window into the Zing VM – Hyperlinked display provides drill-down to root cause

– Both JVM internal and Java program information

– No additional performance overhead

– Nothing special to install or configure

– Easy to get started as a user

– ZVRobot collects and stores monitoring data

• Collected data is same as ZVision!

©2014 Azul Systems Inc. 3

Page 4: Webinar: Zing Vision: Answering your toughest production Java performance questions

Linux host

Example Zing Vision deployment

HTTP

HTTP

Zing Vision

(Web browser)

©2014 Azul Systems Inc. 4

Zing VM

zvision server

Page 5: Webinar: Zing Vision: Answering your toughest production Java performance questions

Fitting in: Production focus

• Most tools suitable for developers, but too ‘heavy’ for production • Use JVMTI (JVM Tools Interface) and BCI (Byte Code Instrumentation)

• High overhead, so must be used carefully in production

• May require configuration to lower the overhead

• Not practical for Operations teams

• Zing Vision is designed for safe use on production systems • Ideal diagnostic tool to use when you know you have a problem in

production (“a flashlight in a dark place”)

• Integrated with the JVM, so it won’t add overhead or perturb the running Java program

• It’s meant to be used - click on items in the web UI to explore!

©2014 Azul Systems Inc. 5

Page 6: Webinar: Zing Vision: Answering your toughest production Java performance questions

Key features

• Tick profiler

• Thread-level views

• Lock contention view

• Garbage collection views

• Java heap object views – Live objects

– Object types that increase in number as application runs

©2014 Azul Systems Inc. 6

Page 7: Webinar: Zing Vision: Answering your toughest production Java performance questions

Tick Profiler: Find “hot” code

• Goal: Determine what code is hot (consuming most CPU time)

• Approach used by other profiling tools: – Method tracing

– Byte code instrumentation – heavy weight

– Solution: Profile only a user-selected portion of the application

– Drawback: You need to know the location in the code where the performance bottleneck occurs to select the area of the code to profile!

©2014 Azul Systems Inc. 7

Page 8: Webinar: Zing Vision: Answering your toughest production Java performance questions

Tick Profiler: Find “hot” code

Zing Vision uses runtime thread sampling:

• Fast snapshots of the code running in executing Java threads

• Identifies where the work is done in the application

• Lightweight, low overhead – Always on

– Even when you’re not looking at the generated metrics

• Instruction-level granularity – JVM internal threads, too!

• Detailed information about the entire process

– Interpretation sometimes requires understanding of the JVM runtime

©2014 Azul Systems Inc. 8

Page 9: Webinar: Zing Vision: Answering your toughest production Java performance questions

Tick Profiler: How it works

©2014 Azul Systems Inc. 9

Tick profile conveyor belt has a fixed number of positions for profiles.

Note that the conveyor belt only moves when a new profile is added!

This means Zing Vision always shows the most recent data.

Oldest profile drops off… (into the trash) Youngest profile added

1. Thread registers SIG61 signal handler with kernel at

intervals 1 ms (1000 times per second, configurable)

2. Thread runs

3. Kernel delivers SIG61

4. Thread is interrupted on its normal stack

5. Signal handler runs, creates a new (youngest) profile

6. Zing Vision aggregates all of

the profiles on the belt in the

Timer Tick Profile view

Page 10: Webinar: Zing Vision: Answering your toughest production Java performance questions

©2014 Azul Systems Inc.

Tick Profiler: Where is work done?

10

Page 11: Webinar: Zing Vision: Answering your toughest production Java performance questions

Tick Profiler: Where is work done?

©2014 Azul Systems Inc. 11

Filters

Collection controllers

Select link to see details

Page 12: Webinar: Zing Vision: Answering your toughest production Java performance questions

©2014 Azul Systems Inc.

Tick Profiler: Work at instruction level

12

Ticks for each instruction

Callee | Caller

C2 compiled JDK and

application code

Page 13: Webinar: Zing Vision: Answering your toughest production Java performance questions

©2014 Azul Systems Inc.

Tick Profiler: How did I get here?

13

Page 14: Webinar: Zing Vision: Answering your toughest production Java performance questions

Tick Profiler: How did I get here?

©2014 Azul Systems Inc. 14

Sorted based on highest CPU consumers

Top of stack

Top of stack

0 com.sun.tools.javac.util.Name.fromUtf

Page 15: Webinar: Zing Vision: Answering your toughest production Java performance questions

Thread-level questions

• What threads are executing my application?

• What are the housekeeping threads for the JVM?

• Can I examine a thread object?

• What are the threads doing? – Profiling information

– Stack traces

• Where is my application stalled?

©2014 Azul Systems Inc. 15

Page 16: Webinar: Zing Vision: Answering your toughest production Java performance questions

Thread-level views: Standard method

Request thread stacks (kill -3)

Last thread stopped

Resume threads

O(numThreads) delay application visible work stoppage

Time

Thread number: 1 2 3 4 5

Some threads blocked – NO work done

Thread 3 continues to run!

©2014 Azul Systems Inc. 16

Page 17: Webinar: Zing Vision: Answering your toughest production Java performance questions

Thread-level views: Zing Vision method

Request thread stacks (ZVision)

Each thread:

1. Stopped individually

2. Delay order is O(1)

No thread waits for any other thread to stop!

The application never perceives a work

stoppage because N-1 threads continue to

run at all times

Resume each thread seamlessly

Time

Pro: Safe to use in production (guilt-free clicking)

Con: Not 100% consistent (especially for lock data)

Thread number: 1 2 3 4 5

©2014 Azul Systems Inc. 17

Page 18: Webinar: Zing Vision: Answering your toughest production Java performance questions

Thread-level view: Application threads

©2014 Azul Systems Inc. 18

Filters and control

Individual

thread stack

trace and

tick profile

access

Select link to see stack

Page 19: Webinar: Zing Vision: Answering your toughest production Java performance questions

©2014 Azul Systems Inc.

Thread-level view: Thread stack trace

19

Thread CPU time consumed

Stack frames

Select link to see details

Page 20: Webinar: Zing Vision: Answering your toughest production Java performance questions

Thread-level view: Thread object details

©2014 Azul Systems Inc. 20

Values of the object’s fields

Page 21: Webinar: Zing Vision: Answering your toughest production Java performance questions

Thread-level view: Application threads

©2014 Azul Systems Inc. 21

Filters and control

Individual

thread stack

trace and

tick profile

access

Select link to see profile

Page 22: Webinar: Zing Vision: Answering your toughest production Java performance questions

Thread-level: Where is the work done?

©2014 Azul Systems Inc. 22

Thread 8120

Page 23: Webinar: Zing Vision: Answering your toughest production Java performance questions

Lock contention: Where is my app stalled?

©2014 Azul Systems Inc. 23

Lock acquisition

Total and Max times Blocking count

Select link to see details

Page 24: Webinar: Zing Vision: Answering your toughest production Java performance questions

Lock contention: Where is my app stalled?

©2014 Azul Systems Inc. 24

Summary metrics

How did I get to the contended lock in my code?

Page 25: Webinar: Zing Vision: Answering your toughest production Java performance questions

Memory: Answering your questions

• What’s the collector doing?

• How much memory is the application using?

• What type of objects are in the heap? – What’s keeping those objects live?

• What object types are increasing in number?

©2014 Azul Systems Inc. 25

Page 26: Webinar: Zing Vision: Answering your toughest production Java performance questions

Memory: Resource use summary

©2014 Azul Systems Inc. 26

Java heap overview

Process Zing memory use

Linux memory

Page 27: Webinar: Zing Vision: Answering your toughest production Java performance questions

Memory: Collection details

©2014 Azul Systems Inc. 27

Collection details

Page 28: Webinar: Zing Vision: Answering your toughest production Java performance questions

Memory: Collection details summary

©2014 Azul Systems Inc. 28

Detailed

summary

calculating

metric

averages

Page 29: Webinar: Zing Vision: Answering your toughest production Java performance questions

Memory: What objects are in the heap?

©2014 Azul Systems Inc. 29

Objects in Old Generation

Default sorting:

Sum of size of each

object of that type

Expand to see

types with

references to

objects of that type

Page 30: Webinar: Zing Vision: Answering your toughest production Java performance questions

Memory: Which object type is growing?

©2014 Azul Systems Inc. 30

Object types with increasing memory

consumption in the Old Generation

Selectable time interval

Growth

rate

Page 31: Webinar: Zing Vision: Answering your toughest production Java performance questions

Linux host

Zing VM

Linux host

Example ZVRobot deployment

HTTP

Write a file for each Zing Vision web page at

each sample period (for example, every 1

minute) into a directory

Use a web browser to look at the saved snapshot files anytime after

program has run or even during collection

©2014 Azul Systems Inc. 31

31

ZVRobot

Page 32: Webinar: Zing Vision: Answering your toughest production Java performance questions

How to Try Zing Vision - Free

• Request a trial copy of Zing http://www.azulsystems.com/trial

• Download and run Azul Inspector to check your system

• Download and install Zing – Zing Vision and ZVRobot are included

• Run your application

• Observe your application and the JVM’s activity using Zing Vision

©2014 Azul Systems Inc. 32

Page 33: Webinar: Zing Vision: Answering your toughest production Java performance questions

Questions?

Zing Vision – providing answers to your Java performance questions

• Tick profiler

• Thread-level views

• Lock contention view

• Garbage collection views

• Java heap object views

• Live objects

• Object types that increase in number as application runs

©2014 Azul Systems Inc. 33