SlideShare a Scribd company logo
Java Performance Engineer's Survival Guide
About Me
Performance
Engineering
©2016 CodeKaram3
©2016 CodeKaram4
Performance
Requirements
AskQuestions
©2016 CodeKaram6
• What makes the users happy?
• What makes them unhappy?
• Any current issues that need to be tackled?
Define and Understand
©2016 CodeKaram7
• Understand QoS (Quality of Service) for end users
• Define QoS success metrics in measurableterms
• Those are the service level agreements (SLAs)!
©2016 CodeKaram8
• Document, understand and prioritize SLAs
• Throughput
• Responsetime
• Capacity
• Footprint
• CPU utilization?
• …
Define Success!
©2016 CodeKaram9
Monitor, measure and define performance in
terms of throughput, latency, capacity,
footprint, utilization …
Work For It!
Defining Success!
©2016 CodeKaram11
©2016 CodeKaram12
Throughput
©2016 CodeKaram13
• Expected throughput?
• Can you fall below the expected throughput?
• How long can you stay below the expected throughput?
• What is the lowest that you can go?
Throughput
©2016 CodeKaram14
• Throughput measurement
• How is it measured?
• Transactions/sec; messages/sec or all of them?
• Where is it measured?
• Client-side; server-side; browser?
©2016 CodeKaram15
©2016 CodeKaram16
ResponseTime
©2016 CodeKaram17
• Expected response time?
• Can you go above the expected response time?
• How long can you stay there?
• How much can you exceed?
ResponseTime
©2016 CodeKaram18
• Response time measurement
• How is it measured?
• 99th percentile; 5-9s; worst-case; or all?
• Where is it measured?
• Client-side; server-side? Complete loop?
©2016 CodeKaram19
©2016 CodeKaram20
©2016 CodeKaram21
Capacity Management
©2016 CodeKaram22
• What is the expected load?
• What happens if one system gets loaded more than others?
(load balancer issue)
• How is it measured?
Capacity Management
©2016 CodeKaram23
• What’s the max load that a system and all systems can tolerate?
• How long?
• What metrics are being captured?
Performance Analysis
Performance Analysis
^
Performance Analysis
©2016 CodeKaram26
• Analyze what factors enable the end-user experience to
meet or exceed the promised QoS
• Track your SLAs!
Java Application Stack
©2016 CodeKaram27
OS
Hardware
Application Ecosystem
Application
JRE
JVM
©2016 CodeKaram28
• Application services
• Application server
• Database
• Any other services in the ecosystem?
Application Performance Analysis
Application Ecosystem
Application
JVM + Runtime Performance Analysis
©2016 CodeKaram29
JRE
JVM
• Classloading stats
• JIT Compilation stats
• Garbage Collection stats
• Threads stats
OS Performance Analysis
©2016 CodeKaram30
• System/ Kernel stats
• Lock stats
• Threads stats
OS
Hardware Performance Analysis
©2016 CodeKaram31
• Memory bandwidth/ traffic/ consumption
• CPU/ core utilization
• CPU cache efficiency/ utilization/ levels
• Architectural specific?
• IO Stats
Hardware
What areYouTrying to Achieve?
©2016 CodeKaram32
Improve application?
Top-Down Approach
©2016 CodeKaram33
OS
Hardware
Application Ecosystem
Application
JRE
JVM
Top Down Approach - Process
•Step 1Monitor
•Step 2 Profile
•Step 3Analyze
•Step 4 Tune +
Apply
©2016 CodeKaram34
What areYouTrying to Achieve?
©2016 CodeKaram35
Improve the platform?
Bottom-Up Approach
©2016 CodeKaram36
OS
Hardware
Application Ecosystem
Application
JRE
JVM
Bottom Up Approach - Process
•Step 1Monitor
•Step 2 Profile
•Step 3Analyze
•Step 4 Tune +
Apply
©2016 CodeKaram37
Top-Down Approach
Top-Down Approach
©2016 CodeKaram39
I HAVE the power!!
… to modify the code
Top-Down Approach
©2016 CodeKaram40
OS
Hardware
Application Ecosystem
Application
JRE
JVM
Top-Down Approach
©2016 CodeKaram41
Application Ecosystem
Application
OS
Hardware
JRE
JVM
Platform
Step 1: Monitor
©2016 CodeKaram42
Monitor and plot SUT (System UnderTest) statistics
©2016 CodeKaram43
Step 1: Monitor
©2016 CodeKaram44
Step 1: Monitor
©2016 CodeKaram45
Step 1: Monitor
©2016 CodeKaram46
Step 1: Monitor
©2016 CodeKaram47
Step 1: Monitor
©2016 CodeKaram48
• Tools?
• VisualVM, Java Flight Recorder
• PrintCompilation, PrintGCDetails (+PrintGCDateStamps), jmap –
clstats, jcmd GC.class_stats
Step 1: Monitor
©2016 CodeKaram49
• Tools?
• Linux – mpstat, sysstat – iostat,pidstat…, prstat, vmstat, dash, CPU-Z,
cacti …
• Windows – Performance Monitor,Task Manager, Resource Monitor,
CPU-Z, cacti ...
Step 1: Monitor
Step 2+3: Profile + Analyze
©2016 CodeKaram50
• You have all the data that you need!
• Identify areas of improvement
• Profile those potential hotspots
• Analyze those hotspots
©2016 CodeKaram51
• Tools? (Free/Open source/GPL/BSD)
• Oracle Solaris Studio PerformanceAnalyzer, perf tools, PAPI,CodeXL,
Dtrace, Oprofile, gprof, LTT (linux trace toolkit)
• Java Application – VisualVM, Netbeans profiler, jconsole …
Step 2+3: Profile + Analyze
Step 4:Tune
©2016 CodeKaram52
• Tune the JVM/GC – select the right heap, the right
GC algorithm
• Age objects appropriately
• Promote only long-lived objects
• GC worker threads perVM (for stop-the-world
GC events)
• GC concurrent worker threads perVM
Step 4:Tune
©2016 CodeKaram53
• Tune the JVM/GC – select the right heap, the right
GC algorithm
• See if compressed oops can be helpful
• Larger heaps may need AlwaysPretouch to be
enabled and also UseLargePages of
appropriate size
Step 4:Tune
©2016 CodeKaram54
• Tune your code to meet or exceed your SLAs
• Appropriate ramp-ups and ramp-downs
• Object age and retention strategies
• Understand what forms your LDS (live data
set)
• Confirm you are measuring the right thing! J
Bottom-Up Approach
Bottom Up Approach
©2016 CodeKaram56
I NEED the power!!
… to stress the platform
Bottom-Up Approach
©2016 CodeKaram57
OS
Hardware
Application Ecosystem
Application
JRE
JVM
Bottom-Up Approach
©2016 CodeKaram58
Application Ecosystem
Application
OS
Hardware
JRE
JVM
Platform
Where to Start?
©2016 CodeKaram59
• Know what you are stressing
• Get/ write the appropriate workload/ application
• Get/write the appropriate tools
Know WhatYou Are Stressing!
©2016 CodeKaram60
CPU –
Gather performance counter information for your
CPU stats, core stats, cache hits, misses and levels,
branch predictions, pipeline information, order-of-
execution, load-store unit load and queues,etc
Know WhatYou Are Stressing!
©2016 CodeKaram61
Memory –
Gather performance counter information for
memory utilization, memorybandwidth, read-write
stats, max read bandwidth, max write bandwidth,
max cross traffic bandwidth, architectural related
considerations, max capacity, etc
Know WhatYou Are Stressing!
©2016 CodeKaram62
JVM / GC–
Gather information related to the change – e.g. new
GC!
Gather information on different GC phases, parallel
work queues and work performance, concurrent
work and pressure,internal queues and buffers, any
GC work that’s staged?, etc
Where to Next?
©2016 CodeKaram63
• Know what you are stressing
• Get/ write the appropriate workload/ application
• Get/write the appropriate tools
Let’s have some fun!
Further Reading
Java Performance Engineer's Survival Guide
www.codekaram.com
www.slideshare.net/monicabeckwith

More Related Content

PDF
JFokus Java 9 contended locking performance
PDF
Way Improved :) GC Tuning Confessions - presented at JavaOne2015
PDF
GC Tuning Confessions Of A Performance Engineer - Improved :)
PDF
Garbage First Garbage Collector: Where the Rubber Meets the Road!
PDF
The Performance Engineer's Guide To HotSpot Just-in-Time Compilation
PDF
GC Tuning Confessions Of A Performance Engineer
PDF
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
PDF
The Performance Engineer's Guide to Java (HotSpot) Virtual Machine
JFokus Java 9 contended locking performance
Way Improved :) GC Tuning Confessions - presented at JavaOne2015
GC Tuning Confessions Of A Performance Engineer - Improved :)
Garbage First Garbage Collector: Where the Rubber Meets the Road!
The Performance Engineer's Guide To HotSpot Just-in-Time Compilation
GC Tuning Confessions Of A Performance Engineer
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
The Performance Engineer's Guide to Java (HotSpot) Virtual Machine

What's hot (20)

PPTX
Enabling Java: Windows on Arm64 - A Success Story!
PPTX
Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...
PPTX
G1 collector and tuning and Cassandra
PPTX
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
PPTX
G1 Garbage Collector - Big Heaps and Low Pauses?
PDF
-XX:+UseG1GC
PDF
Java 9: The (G1) GC Awakens!
PPT
Java Garbage Collectors – Moving to Java7 Garbage First (G1) Collector
PPTX
Hadoop world g1_gc_forh_base_v4
PDF
Java Performance Tuning
PPT
Performance tuning jvm
PDF
The 2nd half. Scaling to the next^2
PDF
Chaos is a ladder !
PDF
Modern Monitoring [ with Prometheus ]
PPTX
Stacking up with OpenStack: Building for High Availability
PDF
High availability and fault tolerance of openstack
PDF
Processing TeraBytes of data every day and sleeping at night
PDF
Processing TeraBytes of data every day and sleeping at night
PPTX
Open stack HA - Theory to Reality
PPTX
Introduction to Kafka Cruise Control
Enabling Java: Windows on Arm64 - A Success Story!
Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...
G1 collector and tuning and Cassandra
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
G1 Garbage Collector - Big Heaps and Low Pauses?
-XX:+UseG1GC
Java 9: The (G1) GC Awakens!
Java Garbage Collectors – Moving to Java7 Garbage First (G1) Collector
Hadoop world g1_gc_forh_base_v4
Java Performance Tuning
Performance tuning jvm
The 2nd half. Scaling to the next^2
Chaos is a ladder !
Modern Monitoring [ with Prometheus ]
Stacking up with OpenStack: Building for High Availability
High availability and fault tolerance of openstack
Processing TeraBytes of data every day and sleeping at night
Processing TeraBytes of data every day and sleeping at night
Open stack HA - Theory to Reality
Introduction to Kafka Cruise Control
Ad

Viewers also liked (17)

PDF
Game of Performance: A Song of JIT and GC
PDF
Knowing your garbage collector - PyCon Italy 2015
PPTX
Scalable load testing using jmeter in cloud
PDF
Running JMeter Tests In Appvance PerformanceCloud
PPTX
Show Me the Money: Connecting Performance Engineering to Real Business Results
PDF
JMeter, Docker sitting in a tree
PPT
How to use VTS with loadrunner
PPT
Georgia Tech: Performance Engineering - Queuing Theory and Predictive Modeling
PPTX
Performance testing with 100,000 concurrent users in AWS
PPT
Load Test Drupal Site Using JMeter and Amazon AWS
PDF
JVM JIT-compiler overview @ JavaOne Moscow 2013
KEY
3장. Garbage Collection
PPT
Performance Engineering Basics
PDF
Top 8 Trends in Performance Engineering
KEY
JavaOne 2012 - JVM JIT for Dummies
PDF
Asking “What?”, Automating the “How?”: The Vision of Declarative Performan...
PDF
BreizhCamp 2013 - Crash test à haute vitesse
Game of Performance: A Song of JIT and GC
Knowing your garbage collector - PyCon Italy 2015
Scalable load testing using jmeter in cloud
Running JMeter Tests In Appvance PerformanceCloud
Show Me the Money: Connecting Performance Engineering to Real Business Results
JMeter, Docker sitting in a tree
How to use VTS with loadrunner
Georgia Tech: Performance Engineering - Queuing Theory and Predictive Modeling
Performance testing with 100,000 concurrent users in AWS
Load Test Drupal Site Using JMeter and Amazon AWS
JVM JIT-compiler overview @ JavaOne Moscow 2013
3장. Garbage Collection
Performance Engineering Basics
Top 8 Trends in Performance Engineering
JavaOne 2012 - JVM JIT for Dummies
Asking “What?”, Automating the “How?”: The Vision of Declarative Performan...
BreizhCamp 2013 - Crash test à haute vitesse
Ad

Similar to Java Performance Engineer's Survival Guide (20)

PDF
Door to perfomance testing
PPTX
Tuning Java Servers
PDF
The Diabolical Developers Guide to Performance Tuning
PDF
Oracle Soa Suite 11g Performance Tuning Cookbook Osama Oransa
PPTX
Hands on Performance Tuning - Mike Croft
PPTX
Hands-on Performance Workshop - The science of performance
PPTX
Performance eng prakash.sahu
PDF
Tools and Tips to Diagnose Performance Issues
PDF
Adtech x Scala x Performance tuning
PDF
Adtech scala-performance-tuning-150323223738-conversion-gate01
PDF
Performance Testing Java Applications
PDF
BDM37: Hadoop in production – the war stories by Nikolaï Grigoriev, Principal...
PPTX
Jee performance tuning existing applications
ODP
Jvm tuning in a rush! - Lviv JUG
PPTX
Enterprise application performance - Understanding & Learnings
PDF
Slices Of Performance in Java - Oleksandr Bodnar
PDF
Testing Storage Systems: Methodology and Common Pitfalls
PPTX
Optimizing Java
PPTX
Java PerformanceChapter_7
PPTX
Application Profiling for Memory and Performance
Door to perfomance testing
Tuning Java Servers
The Diabolical Developers Guide to Performance Tuning
Oracle Soa Suite 11g Performance Tuning Cookbook Osama Oransa
Hands on Performance Tuning - Mike Croft
Hands-on Performance Workshop - The science of performance
Performance eng prakash.sahu
Tools and Tips to Diagnose Performance Issues
Adtech x Scala x Performance tuning
Adtech scala-performance-tuning-150323223738-conversion-gate01
Performance Testing Java Applications
BDM37: Hadoop in production – the war stories by Nikolaï Grigoriev, Principal...
Jee performance tuning existing applications
Jvm tuning in a rush! - Lviv JUG
Enterprise application performance - Understanding & Learnings
Slices Of Performance in Java - Oleksandr Bodnar
Testing Storage Systems: Methodology and Common Pitfalls
Optimizing Java
Java PerformanceChapter_7
Application Profiling for Memory and Performance

More from Monica Beckwith (8)

PPTX
The ilities of software engineering.pptx
PPTX
A G1GC Saga-KCJUG.pptx
PDF
ZGC-SnowOne.pdf
PDF
QCon London.pdf
PDF
Applying Concurrency Cookbook Recipes to SPEC JBB
PPTX
Intro to Garbage Collection
PPTX
OpenJDK Concurrent Collectors
PDF
OPENJDK: IN THE NEW AGE OF CONCURRENT GARBAGE COLLECTORS
The ilities of software engineering.pptx
A G1GC Saga-KCJUG.pptx
ZGC-SnowOne.pdf
QCon London.pdf
Applying Concurrency Cookbook Recipes to SPEC JBB
Intro to Garbage Collection
OpenJDK Concurrent Collectors
OPENJDK: IN THE NEW AGE OF CONCURRENT GARBAGE COLLECTORS

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PDF
KodekX | Application Modernization Development
PDF
Modernizing your data center with Dell and AMD
PPTX
A Presentation on Artificial Intelligence
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PPT
Teaching material agriculture food technology
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Cloud computing and distributed systems.
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Encapsulation theory and applications.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Electronic commerce courselecture one. Pdf
KodekX | Application Modernization Development
Modernizing your data center with Dell and AMD
A Presentation on Artificial Intelligence
NewMind AI Weekly Chronicles - August'25 Week I
Chapter 3 Spatial Domain Image Processing.pdf
NewMind AI Monthly Chronicles - July 2025
Teaching material agriculture food technology
Review of recent advances in non-invasive hemoglobin estimation
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Empathic Computing: Creating Shared Understanding
Cloud computing and distributed systems.
Dropbox Q2 2025 Financial Results & Investor Presentation
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Understanding_Digital_Forensics_Presentation.pptx
Encapsulation theory and applications.pdf
cuic standard and advanced reporting.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

Java Performance Engineer's Survival Guide