SlideShare una empresa de Scribd logo
1 de 78
And other Tips & Tricks to make you a “Performance Expert”
More on http://blog.dynatrace.com
Andreas Grabner - @grabnerandi
Java One 2015 – Deep Dive
Top Performance Mistakes
Safe Harbor 
AND MANY MORE
0.02ms
0.01ms
15 Years: That’s why I ended up talking about performance
Where do your
Stories come
from?
#1: Real Life & Real User Stories
#2: http://bit.ly/onlineperfclinic
#3: http://bit.ly/sharepurepath
20%
80%
Frontend Performance
We are getting FATer!
Example of a “Bad” Web Deployment 282! Objects
on that page9.68MB Page Size
8.8s Page Load
Time
Most objects are images
delivered from your main
domain
Very long Connect time
(1.8s) to your CDN
Mobile landing page of Super Bowl ad
434 Resources in total on that page:
230 JPEGs, 75 PNGs, 50 GIFs, …
Total size of ~
20MB
Fifa.com during Worldcup
Source: http://apmblog.compuware.com/2014/05/21/is-the-fifa-world-cup-website-ready-for-the-tournament/
8MB of background image for STPCon (Word Press)
Make F12 or Browser Agent your friend!
Compare yourself Online!
Key Metrics
# of Resources
Size of Resources
Total Size of Content
• Browser Built-In Developer Tools
• Extensions such as YSlow, PageSpeed
• Online Tools
• WebPageTest
• Google PageSpeed Insights
• Dynatrace Performance Center
• ...
• Automate!! With Selenium, WebDriver, Cucumber, ...
Tooling
Frontend Availability
Back to Basics Please!
Online Services for you: Is it down right now?
Online Services for you: Outage Analyzer
Tip for handling Spike Load: GO LEAN!!
1h before
SuperBowl KickOff
1h after
Game ended
Key Metrics
HTTP 3xx, 4xx, 5xx
# of Domains
• Dynatrace Synthetic
• Ruxit Synthetic
• NewRelic Synthetic
• AppDynamics
• PingDom
• ... Just Google for „Synthetic Monitoring“
Online Services
Backend Performance
The Usual Suspects
• Symptoms
• HTML takes between 60 and 120s to render
• High GC Time
• Developer Assumptions
• Bad GC Tuning
• Probably bad Database Performance as rendering was simple
• Result: 2 Years of Finger pointing between Dev and DBA
Project: Online Room Reservation System
Developers built own monitoring
void roomreservationReport(int officeId)
{
long startTime = System.currentTimeMillis();
Object data = loadDataForOffice(officeId);
long dataLoadTime = System.currentTimeMillis() - startTime;
generateReport(data, officeId);
}
Result:
Avg. Data Load Time: 45s!
DB Tool says:
Avg. SQL Query: <1ms!
#1: Loading too much data
24889! Calls to the Database
API!
High CPU and High Memory Usage
to keep all data in Memory
#2: On individual connections 12444!
individual
connections
Classical N+1 Query
Problem
Individual SQL
really <1ms
#3: Putting all data in temp Hashtable
Lots of time spent in
Hashtable.get
Called from their Entity
Objects
• … you know what code is doing you inherited!!
• … you are not making mistakes like this 
• Explore the Right Tools
• Built-In Database Analysis Tools
• “Logging” options of Frameworks such as Hibernate, …
• JMX, Perf Counters, … of your Application Servers
• Performance Tracing Tools: Dynatrace, Ruxit, NewRelic,
AppDynamics, Your Profiler of Choice …
Lessons Learned – Don’t Assume …
Key Metrics
# of SQL Calls
# of same SQL Execs (1+N)
# of Connections
Rows/Data Transferred
Backend Performance
Architectural Mistakes with
„Migrating“ to (Micro)Services
26.7s Execution
Time
33! Calls to the same
Web Service
171! SQL Queries through LINQ
by this Web Service – request
similar data for each call
Architecture Violation: Direct access to DB instead
from frontend logic
21671! Calls to Oracle
3136! Calls to H2
mostly executed on
async background
threads
33! Different
connections used
DB Exceptions on both
Databases
DB Exceptions on both
Databases
40! internal Web
Service Calls that
do all these DB
Updates
Key Metrics
# of Service Calls
Payload of Service Calls
# of Involved Threads
1+N Service Call Pattern!
• Dynatrace
• Ruxit
• NewRelic
• AppDynamics
• Any Profiler that can trace across tiers
• Google for Tracing or APM (Application Performance
Management)
Tooling
Logging
WE CAN LOG THIS!!
LOG
Log Hotspots in Frameworks!
callAppenders clear CPU and I/O Hotspot
Excessive logging through Spring Framework
Debug Log and outdated log4j library
#1: Top Problem: log4j.callAppenders
-> 71% Sync Time
#2: Most of logging done from
fillDetail method
#3: Doing “DEBUG” log
output: Is this necessary?
Key Metrics
# of Log Entries
Size of Logs per Use Case
Response Time is not the only
Performance Indicator
Look at Resources as well
Is this a successful new Build?
Look at Resource Usage: CPU, Memory, …
Memory? Look at Heap Generations
Root Cause: Dependency Injection
Prevent: Monitor Memory Metrics for every Build
#3: Growing
“Old Gen” is a
good indicator
for a Mem Leak
#4: Heavy GC
kicks in when
Old
Generation is
full!
#5: Throughput
of Application
goes to 0 due to
no memory
available
#1: Eden Space stays constant.
Objects being propagated to
Survivor Space
#2: GC Activity in Young
Generation ultimately
moves objects into Old
Generation
Key Metrics
# of Objects per Generation
# of GC Runs
Total Impact of GC
Tips & Tricks
And more Metrics of course 
Tip: Layer Breakdown over Time
With increasing load: Which LAYER
doesn’t SCALE?
Tip: Exceptions and Log Messages
How are # of EXCEPTIONS
evolving over time?
How many SEVERE LOG
messages to we write in
relation to Exceptions?
Tip: Failed Transactions
Are more TRANSACTIONS
FAILING (HTTP 5xx, 4xx, …)
under heavier load?
Tip: Database Activity
Do we see increased in AVG #
of SQL Executions over Time?
Do TOTAL # of SQL Executions
increase with load? Shouldn’t
it flatten due to CACHES?
Tip: Database History Dashboard
How many SQL Statements are
PREPARED?
What’s the overall Execution
Time of different SQL Types
(SELECT, INSERT, DELETE, …)
Tip: DB Connection Pool Utilization
Do we have enough DB
CONNECTIONS per pool?
For more Key Metrics
http://blog.dynatrace.com
http://blog.ruxit.com
We want to get from here …
To here!
Use these application metrics as additional
Quality Gates
71
What you currently measure
What you should measure
Quality Metrics
in your CI
# Test Failures
Overall Duration
Execution Time per test
# calls to API
# executed SQL statements
# Web Service Calls
# JMS Messages
# Objects Allocated
# Exceptions
# Log Messages
# HTTP 4xx/5xx
Request/Response Size
Page Load/Rendering Time
…
Connecting your Tests with Quality
12 0 120ms
3 1 68ms
Build 20 testPurchase OK
testSearch OK
Build 17 testPurchase OK
testSearch OK
Build 18 testPurchase FAILED
testSearch OK
Build 19 testPurchase OK
testSearch OK
Build # Test Case Status # SQL # Excep CPU
12 0 120ms
3 1 68ms
12 5 60ms
3 1 68ms
75 0 230ms
3 1 68ms
Test Framework Results Architectural Data
We identified a regresesion
Problem solved
Exceptions probably reason for
failed tests
Problem fixed but now we have an
architectural regression
Problem fixed but now we have an
architectural regressionNow we have the functional and
architectural confidence
Let’s look behind the
scenes
#1: Analyzing each Test
#2: Metrics for each Test
#3: Detecting Regression
based on Measure
Quality-Metrics based
Build Status
Pull data into Jenkins, Bamboo ...
Making Quality a first-class citizen
„Too hard“
„we‘ll get round to this later“
„not cool enough“
Questions and/or Demo
Slides: slideshare.net/grabnerandi
Get Tools: bit.ly/dttrial
YouTube Tutorials: bit.ly/dttutorials
Contact Me: agrabner@dynatrace.com
Follow Me: @grabnerandi
Read More: blog.dynatrace.com
Andreas Grabner
Dynatrace Developer Advocate
@grabnerandi
http://blog.dynatrace.com

Más contenido relacionado

La actualidad más candente

DevOps Days Toronto: From 6 Months Waterfall to 1 hour Code Deploys
DevOps Days Toronto: From 6 Months Waterfall to 1 hour Code DeploysDevOps Days Toronto: From 6 Months Waterfall to 1 hour Code Deploys
DevOps Days Toronto: From 6 Months Waterfall to 1 hour Code Deploys
Andreas Grabner
 
Nginx performance monitoring with Dynatrace
Nginx performance monitoring with DynatraceNginx performance monitoring with Dynatrace
Nginx performance monitoring with Dynatrace
Harald Zeitlhofer
 

La actualidad más candente (20)

Hugs instead of Bugs: Dreaming of Quality Tools for Devs and Testers
Hugs instead of Bugs: Dreaming of Quality Tools for Devs and TestersHugs instead of Bugs: Dreaming of Quality Tools for Devs and Testers
Hugs instead of Bugs: Dreaming of Quality Tools for Devs and Testers
 
Java Performance Mistakes
Java Performance MistakesJava Performance Mistakes
Java Performance Mistakes
 
London WebPerf Meetup: End-To-End Performance Problems
London WebPerf Meetup: End-To-End Performance ProblemsLondon WebPerf Meetup: End-To-End Performance Problems
London WebPerf Meetup: End-To-End Performance Problems
 
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
 
OOP 2016 - Building Software That Eats The World
OOP 2016 - Building Software That Eats The WorldOOP 2016 - Building Software That Eats The World
OOP 2016 - Building Software That Eats The World
 
Mobile User Experience: Auto Drive through Performance Metrics
Mobile User Experience:Auto Drive through Performance MetricsMobile User Experience:Auto Drive through Performance Metrics
Mobile User Experience: Auto Drive through Performance Metrics
 
Application Quality Gates in Continuous Delivery: Deliver Better Software Fas...
Application Quality Gates in Continuous Delivery: Deliver Better Software Fas...Application Quality Gates in Continuous Delivery: Deliver Better Software Fas...
Application Quality Gates in Continuous Delivery: Deliver Better Software Fas...
 
Top .NET, Java & Web Performance Mistakes - Meetup Jan 2015
Top .NET, Java & Web Performance Mistakes - Meetup Jan 2015Top .NET, Java & Web Performance Mistakes - Meetup Jan 2015
Top .NET, Java & Web Performance Mistakes - Meetup Jan 2015
 
(R)evolutionize APM
(R)evolutionize APM(R)evolutionize APM
(R)evolutionize APM
 
How to explain DevOps to your mom
How to explain DevOps to your momHow to explain DevOps to your mom
How to explain DevOps to your mom
 
How to keep you out of the News: Web and End-to-End Performance Tips
How to keep you out of the News: Web and End-to-End Performance TipsHow to keep you out of the News: Web and End-to-End Performance Tips
How to keep you out of the News: Web and End-to-End Performance Tips
 
Dyna trace
Dyna traceDyna trace
Dyna trace
 
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
 
Metrics Driven DevOps - Automate Scalability and Performance Into your Pipeline
Metrics Driven DevOps - Automate Scalability and Performance Into your PipelineMetrics Driven DevOps - Automate Scalability and Performance Into your Pipeline
Metrics Driven DevOps - Automate Scalability and Performance Into your Pipeline
 
DevOps Days Toronto: From 6 Months Waterfall to 1 hour Code Deploys
DevOps Days Toronto: From 6 Months Waterfall to 1 hour Code DeploysDevOps Days Toronto: From 6 Months Waterfall to 1 hour Code Deploys
DevOps Days Toronto: From 6 Months Waterfall to 1 hour Code Deploys
 
Metrics-Driven Devops: Delivering High Quality Software Faster!
Metrics-Driven Devops: Delivering High Quality Software Faster! Metrics-Driven Devops: Delivering High Quality Software Faster!
Metrics-Driven Devops: Delivering High Quality Software Faster!
 
Troubleshooting ASP.NET and IIS Scalability Hotspots
Troubleshooting ASP.NET and IIS Scalability HotspotsTroubleshooting ASP.NET and IIS Scalability Hotspots
Troubleshooting ASP.NET and IIS Scalability Hotspots
 
Continuous Deployment: The Dirty Details
Continuous Deployment: The Dirty DetailsContinuous Deployment: The Dirty Details
Continuous Deployment: The Dirty Details
 
Nginx performance monitoring with Dynatrace
Nginx performance monitoring with DynatraceNginx performance monitoring with Dynatrace
Nginx performance monitoring with Dynatrace
 
JavaOne - Performance Focused DevOps to Improve Cont Delivery
JavaOne - Performance Focused DevOps to Improve Cont DeliveryJavaOne - Performance Focused DevOps to Improve Cont Delivery
JavaOne - Performance Focused DevOps to Improve Cont Delivery
 

Destacado

Arh2050 sp2015 syllabus
Arh2050 sp2015 syllabusArh2050 sp2015 syllabus
Arh2050 sp2015 syllabus
ProfWillAdams
 
Beyond profit sig carbon finance
Beyond profit sig carbon financeBeyond profit sig carbon finance
Beyond profit sig carbon finance
Elaine Chow
 
Hum2220 fa2015 research project packet
Hum2220 fa2015 research project packetHum2220 fa2015 research project packet
Hum2220 fa2015 research project packet
ProfWillAdams
 
SchaalX Korte Presentatie
SchaalX Korte PresentatieSchaalX Korte Presentatie
SchaalX Korte Presentatie
WendaKeijzer
 

Destacado (20)

Boston DevOps Days 2016: Implementing Metrics Driven DevOps - Why and How
Boston DevOps Days 2016: Implementing Metrics Driven DevOps - Why and HowBoston DevOps Days 2016: Implementing Metrics Driven DevOps - Why and How
Boston DevOps Days 2016: Implementing Metrics Driven DevOps - Why and How
 
DevOps Pipelines and Metrics Driven Feedback Loops
DevOps Pipelines and Metrics Driven Feedback LoopsDevOps Pipelines and Metrics Driven Feedback Loops
DevOps Pipelines and Metrics Driven Feedback Loops
 
Practices of Good Software Architects
Practices of Good Software ArchitectsPractices of Good Software Architects
Practices of Good Software Architects
 
ergasiaistoria3
ergasiaistoria3ergasiaistoria3
ergasiaistoria3
 
Nait
NaitNait
Nait
 
Направи си сам суперкомпютър
Направи си сам суперкомпютърНаправи си сам суперкомпютър
Направи си сам суперкомпютър
 
Loopbaanbeleid
LoopbaanbeleidLoopbaanbeleid
Loopbaanbeleid
 
API Design and Enterprise Mobile Apps
API Design and Enterprise Mobile AppsAPI Design and Enterprise Mobile Apps
API Design and Enterprise Mobile Apps
 
Alcol e psoriasi ita
Alcol e psoriasi itaAlcol e psoriasi ita
Alcol e psoriasi ita
 
"Green Urbanism" & "Contextualism"
"Green Urbanism" & "Contextualism""Green Urbanism" & "Contextualism"
"Green Urbanism" & "Contextualism"
 
華語教學必用的雙拼快注音Instant bopomo chinese phonetic symbols
華語教學必用的雙拼快注音Instant bopomo chinese phonetic symbols華語教學必用的雙拼快注音Instant bopomo chinese phonetic symbols
華語教學必用的雙拼快注音Instant bopomo chinese phonetic symbols
 
Exploring Cloud Credentials for Institutional Use
Exploring Cloud Credentials for Institutional UseExploring Cloud Credentials for Institutional Use
Exploring Cloud Credentials for Institutional Use
 
Arh2050 sp2015 syllabus
Arh2050 sp2015 syllabusArh2050 sp2015 syllabus
Arh2050 sp2015 syllabus
 
Beyond profit sig carbon finance
Beyond profit sig carbon financeBeyond profit sig carbon finance
Beyond profit sig carbon finance
 
Hum2220 fa2015 research project packet
Hum2220 fa2015 research project packetHum2220 fa2015 research project packet
Hum2220 fa2015 research project packet
 
Problemas de aprendizaje
Problemas de aprendizajeProblemas de aprendizaje
Problemas de aprendizaje
 
상상지니릴레이
상상지니릴레이상상지니릴레이
상상지니릴레이
 
SchaalX Korte Presentatie
SchaalX Korte PresentatieSchaalX Korte Presentatie
SchaalX Korte Presentatie
 
Obesità e stress ossidativo: una relazione pericolosa.
Obesità e stress ossidativo: una relazione pericolosa. Obesità e stress ossidativo: una relazione pericolosa.
Obesità e stress ossidativo: una relazione pericolosa.
 
Architecture | Thinking Distributed to Improve Agility | Jamie Allsop
Architecture | Thinking Distributed to Improve Agility | Jamie AllsopArchitecture | Thinking Distributed to Improve Agility | Jamie Allsop
Architecture | Thinking Distributed to Improve Agility | Jamie Allsop
 

Similar a JavaOne 2015: Top Performance Patterns Deep Dive

London web perfug_performancefocused_devops_feb2014
London web perfug_performancefocused_devops_feb2014London web perfug_performancefocused_devops_feb2014
London web perfug_performancefocused_devops_feb2014
Andreas Grabner
 

Similar a JavaOne 2015: Top Performance Patterns Deep Dive (20)

JUG Poznan - 2017.01.31
JUG Poznan - 2017.01.31 JUG Poznan - 2017.01.31
JUG Poznan - 2017.01.31
 
Become a Performance Diagnostics Hero
Become a Performance Diagnostics HeroBecome a Performance Diagnostics Hero
Become a Performance Diagnostics Hero
 
Industry Keynote at Large Scale Testing Workshop 2015
Industry Keynote at Large Scale Testing Workshop 2015Industry Keynote at Large Scale Testing Workshop 2015
Industry Keynote at Large Scale Testing Workshop 2015
 
Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...
Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...
Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...
 
Ship code like a keptn
Ship code like a keptnShip code like a keptn
Ship code like a keptn
 
Performance eng prakash.sahu
Performance eng prakash.sahuPerformance eng prakash.sahu
Performance eng prakash.sahu
 
Starting Your DevOps Journey – Practical Tips for Ops
Starting Your DevOps Journey – Practical Tips for OpsStarting Your DevOps Journey – Practical Tips for Ops
Starting Your DevOps Journey – Practical Tips for Ops
 
Five Ways to Fix Your SQL Server Dev-Test Problems
Five Ways to Fix Your SQL Server Dev-Test Problems Five Ways to Fix Your SQL Server Dev-Test Problems
Five Ways to Fix Your SQL Server Dev-Test Problems
 
SharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi Vončina
 
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
 
Performance Testing
Performance TestingPerformance Testing
Performance Testing
 
Why And When Should We Consider Stream Processing In Our Solutions Teqnation ...
Why And When Should We Consider Stream Processing In Our Solutions Teqnation ...Why And When Should We Consider Stream Processing In Our Solutions Teqnation ...
Why And When Should We Consider Stream Processing In Our Solutions Teqnation ...
 
DevOps: Find Solutions, Not More Defects
DevOps: Find Solutions, Not More DefectsDevOps: Find Solutions, Not More Defects
DevOps: Find Solutions, Not More Defects
 
Apex triggers i
Apex triggers iApex triggers i
Apex triggers i
 
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
 Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
 
Profiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty DetailsProfiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty Details
 
Correlate Log Data with Business Metrics Like a Jedi
Correlate Log Data with Business Metrics Like a JediCorrelate Log Data with Business Metrics Like a Jedi
Correlate Log Data with Business Metrics Like a Jedi
 
Monitoring microservice applications: An SRE’s perspective
Monitoring microservice applications: An SRE’s perspectiveMonitoring microservice applications: An SRE’s perspective
Monitoring microservice applications: An SRE’s perspective
 
London web perfug_performancefocused_devops_feb2014
London web perfug_performancefocused_devops_feb2014London web perfug_performancefocused_devops_feb2014
London web perfug_performancefocused_devops_feb2014
 
ATAGTR2017 Unified APM: The new age performance monitoring for production sys...
ATAGTR2017 Unified APM: The new age performance monitoring for production sys...ATAGTR2017 Unified APM: The new age performance monitoring for production sys...
ATAGTR2017 Unified APM: The new age performance monitoring for production sys...
 

Más de Andreas Grabner

Más de Andreas Grabner (16)

KCD Munich - Cloud Native Platform Dilemma - Turning it into an Opportunity
KCD Munich - Cloud Native Platform Dilemma - Turning it into an OpportunityKCD Munich - Cloud Native Platform Dilemma - Turning it into an Opportunity
KCD Munich - Cloud Native Platform Dilemma - Turning it into an Opportunity
 
OpenTelemetry For GitOps: Tracing Deployments from Git Commit to Production
OpenTelemetry For GitOps: Tracing Deployments from Git Commit to ProductionOpenTelemetry For GitOps: Tracing Deployments from Git Commit to Production
OpenTelemetry For GitOps: Tracing Deployments from Git Commit to Production
 
Don't Deploy Into the Dark: DORA Metrics for your K8s GitOps Deployments
Don't Deploy Into the Dark: DORA Metrics for your K8s GitOps DeploymentsDon't Deploy Into the Dark: DORA Metrics for your K8s GitOps Deployments
Don't Deploy Into the Dark: DORA Metrics for your K8s GitOps Deployments
 
Observability and Orchestration of your GitOps Deployments with Keptn
Observability and Orchestration of your GitOps Deployments with KeptnObservability and Orchestration of your GitOps Deployments with Keptn
Observability and Orchestration of your GitOps Deployments with Keptn
 
Release Readiness Validation with Keptn for Austrian Online Banking Software
Release Readiness Validation with Keptn for Austrian Online Banking SoftwareRelease Readiness Validation with Keptn for Austrian Online Banking Software
Release Readiness Validation with Keptn for Austrian Online Banking Software
 
Adding Security to your SLO-based Release Validation with Keptn
Adding Security to your SLO-based Release Validation with KeptnAdding Security to your SLO-based Release Validation with Keptn
Adding Security to your SLO-based Release Validation with Keptn
 
A Guide to Event-Driven SRE-inspired DevOps
A Guide to Event-Driven SRE-inspired DevOpsA Guide to Event-Driven SRE-inspired DevOps
A Guide to Event-Driven SRE-inspired DevOps
 
Jenkins Online Meetup - Automated SLI based Build Validation with Keptn
Jenkins Online Meetup - Automated SLI based Build Validation with KeptnJenkins Online Meetup - Automated SLI based Build Validation with Keptn
Jenkins Online Meetup - Automated SLI based Build Validation with Keptn
 
Continuous Delivery and Automated Operations on k8s with keptn
Continuous Delivery and Automated Operations on k8s with keptnContinuous Delivery and Automated Operations on k8s with keptn
Continuous Delivery and Automated Operations on k8s with keptn
 
Keptn - Automated Operations & Continuous Delivery for k8s
Keptn - Automated Operations & Continuous Delivery for k8sKeptn - Automated Operations & Continuous Delivery for k8s
Keptn - Automated Operations & Continuous Delivery for k8s
 
Shipping Code like a keptn: Continuous Delivery & Automated Operations on k8s
Shipping Code like a keptn: Continuous Delivery & Automated Operations on k8sShipping Code like a keptn: Continuous Delivery & Automated Operations on k8s
Shipping Code like a keptn: Continuous Delivery & Automated Operations on k8s
 
Top Performance Problems in Distributed Architectures
Top Performance Problems in Distributed ArchitecturesTop Performance Problems in Distributed Architectures
Top Performance Problems in Distributed Architectures
 
Applying AI to Performance Engineering: Shift-Left, Shift-Right, Self-Healing
Applying AI to Performance Engineering: Shift-Left, Shift-Right, Self-HealingApplying AI to Performance Engineering: Shift-Left, Shift-Right, Self-Healing
Applying AI to Performance Engineering: Shift-Left, Shift-Right, Self-Healing
 
Monitoring as a Self-Service in Atlassian DevOps Toolchain
Monitoring as a Self-Service in Atlassian DevOps ToolchainMonitoring as a Self-Service in Atlassian DevOps Toolchain
Monitoring as a Self-Service in Atlassian DevOps Toolchain
 
AWS Summit - Trends in Advanced Monitoring for AWS environments
AWS Summit - Trends in Advanced Monitoring for AWS environmentsAWS Summit - Trends in Advanced Monitoring for AWS environments
AWS Summit - Trends in Advanced Monitoring for AWS environments
 
DevOps Transformation at Dynatrace and with Dynatrace
DevOps Transformation at Dynatrace and with DynatraceDevOps Transformation at Dynatrace and with Dynatrace
DevOps Transformation at Dynatrace and with Dynatrace
 

Último

%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 

Último (20)

Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 

JavaOne 2015: Top Performance Patterns Deep Dive

  • 1. And other Tips & Tricks to make you a “Performance Expert” More on http://blog.dynatrace.com Andreas Grabner - @grabnerandi Java One 2015 – Deep Dive Top Performance Mistakes
  • 5.
  • 6.
  • 7. 15 Years: That’s why I ended up talking about performance
  • 9. #1: Real Life & Real User Stories
  • 12.
  • 14.
  • 15. Frontend Performance We are getting FATer!
  • 16.
  • 17.
  • 18. Example of a “Bad” Web Deployment 282! Objects on that page9.68MB Page Size 8.8s Page Load Time Most objects are images delivered from your main domain Very long Connect time (1.8s) to your CDN
  • 19. Mobile landing page of Super Bowl ad 434 Resources in total on that page: 230 JPEGs, 75 PNGs, 50 GIFs, … Total size of ~ 20MB
  • 20. Fifa.com during Worldcup Source: http://apmblog.compuware.com/2014/05/21/is-the-fifa-world-cup-website-ready-for-the-tournament/
  • 21. 8MB of background image for STPCon (Word Press)
  • 22. Make F12 or Browser Agent your friend!
  • 24. Key Metrics # of Resources Size of Resources Total Size of Content
  • 25. • Browser Built-In Developer Tools • Extensions such as YSlow, PageSpeed • Online Tools • WebPageTest • Google PageSpeed Insights • Dynatrace Performance Center • ... • Automate!! With Selenium, WebDriver, Cucumber, ... Tooling
  • 27.
  • 28.
  • 29.
  • 30. Online Services for you: Is it down right now?
  • 31. Online Services for you: Outage Analyzer
  • 32. Tip for handling Spike Load: GO LEAN!! 1h before SuperBowl KickOff 1h after Game ended
  • 33. Key Metrics HTTP 3xx, 4xx, 5xx # of Domains
  • 34. • Dynatrace Synthetic • Ruxit Synthetic • NewRelic Synthetic • AppDynamics • PingDom • ... Just Google for „Synthetic Monitoring“ Online Services
  • 36. • Symptoms • HTML takes between 60 and 120s to render • High GC Time • Developer Assumptions • Bad GC Tuning • Probably bad Database Performance as rendering was simple • Result: 2 Years of Finger pointing between Dev and DBA Project: Online Room Reservation System
  • 37. Developers built own monitoring void roomreservationReport(int officeId) { long startTime = System.currentTimeMillis(); Object data = loadDataForOffice(officeId); long dataLoadTime = System.currentTimeMillis() - startTime; generateReport(data, officeId); } Result: Avg. Data Load Time: 45s! DB Tool says: Avg. SQL Query: <1ms!
  • 38. #1: Loading too much data 24889! Calls to the Database API! High CPU and High Memory Usage to keep all data in Memory
  • 39. #2: On individual connections 12444! individual connections Classical N+1 Query Problem Individual SQL really <1ms
  • 40. #3: Putting all data in temp Hashtable Lots of time spent in Hashtable.get Called from their Entity Objects
  • 41. • … you know what code is doing you inherited!! • … you are not making mistakes like this  • Explore the Right Tools • Built-In Database Analysis Tools • “Logging” options of Frameworks such as Hibernate, … • JMX, Perf Counters, … of your Application Servers • Performance Tracing Tools: Dynatrace, Ruxit, NewRelic, AppDynamics, Your Profiler of Choice … Lessons Learned – Don’t Assume …
  • 42. Key Metrics # of SQL Calls # of same SQL Execs (1+N) # of Connections Rows/Data Transferred
  • 43. Backend Performance Architectural Mistakes with „Migrating“ to (Micro)Services
  • 44. 26.7s Execution Time 33! Calls to the same Web Service 171! SQL Queries through LINQ by this Web Service – request similar data for each call Architecture Violation: Direct access to DB instead from frontend logic
  • 45. 21671! Calls to Oracle 3136! Calls to H2 mostly executed on async background threads 33! Different connections used DB Exceptions on both Databases DB Exceptions on both Databases 40! internal Web Service Calls that do all these DB Updates
  • 46. Key Metrics # of Service Calls Payload of Service Calls # of Involved Threads 1+N Service Call Pattern!
  • 47. • Dynatrace • Ruxit • NewRelic • AppDynamics • Any Profiler that can trace across tiers • Google for Tracing or APM (Application Performance Management) Tooling
  • 48. Logging WE CAN LOG THIS!! LOG
  • 49. Log Hotspots in Frameworks! callAppenders clear CPU and I/O Hotspot Excessive logging through Spring Framework
  • 50. Debug Log and outdated log4j library #1: Top Problem: log4j.callAppenders -> 71% Sync Time #2: Most of logging done from fillDetail method #3: Doing “DEBUG” log output: Is this necessary?
  • 51. Key Metrics # of Log Entries Size of Logs per Use Case
  • 52. Response Time is not the only Performance Indicator Look at Resources as well
  • 53. Is this a successful new Build?
  • 54. Look at Resource Usage: CPU, Memory, …
  • 55. Memory? Look at Heap Generations
  • 57. Prevent: Monitor Memory Metrics for every Build
  • 58. #3: Growing “Old Gen” is a good indicator for a Mem Leak #4: Heavy GC kicks in when Old Generation is full! #5: Throughput of Application goes to 0 due to no memory available #1: Eden Space stays constant. Objects being propagated to Survivor Space #2: GC Activity in Young Generation ultimately moves objects into Old Generation
  • 59. Key Metrics # of Objects per Generation # of GC Runs Total Impact of GC
  • 60. Tips & Tricks And more Metrics of course 
  • 61. Tip: Layer Breakdown over Time With increasing load: Which LAYER doesn’t SCALE?
  • 62. Tip: Exceptions and Log Messages How are # of EXCEPTIONS evolving over time? How many SEVERE LOG messages to we write in relation to Exceptions?
  • 63. Tip: Failed Transactions Are more TRANSACTIONS FAILING (HTTP 5xx, 4xx, …) under heavier load?
  • 64. Tip: Database Activity Do we see increased in AVG # of SQL Executions over Time? Do TOTAL # of SQL Executions increase with load? Shouldn’t it flatten due to CACHES?
  • 65. Tip: Database History Dashboard How many SQL Statements are PREPARED? What’s the overall Execution Time of different SQL Types (SELECT, INSERT, DELETE, …)
  • 66. Tip: DB Connection Pool Utilization Do we have enough DB CONNECTIONS per pool?
  • 67. For more Key Metrics http://blog.dynatrace.com http://blog.ruxit.com
  • 68. We want to get from here …
  • 70. Use these application metrics as additional Quality Gates
  • 71. 71 What you currently measure What you should measure Quality Metrics in your CI # Test Failures Overall Duration Execution Time per test # calls to API # executed SQL statements # Web Service Calls # JMS Messages # Objects Allocated # Exceptions # Log Messages # HTTP 4xx/5xx Request/Response Size Page Load/Rendering Time …
  • 72. Connecting your Tests with Quality 12 0 120ms 3 1 68ms Build 20 testPurchase OK testSearch OK Build 17 testPurchase OK testSearch OK Build 18 testPurchase FAILED testSearch OK Build 19 testPurchase OK testSearch OK Build # Test Case Status # SQL # Excep CPU 12 0 120ms 3 1 68ms 12 5 60ms 3 1 68ms 75 0 230ms 3 1 68ms Test Framework Results Architectural Data We identified a regresesion Problem solved Exceptions probably reason for failed tests Problem fixed but now we have an architectural regression Problem fixed but now we have an architectural regressionNow we have the functional and architectural confidence Let’s look behind the scenes
  • 73. #1: Analyzing each Test #2: Metrics for each Test #3: Detecting Regression based on Measure
  • 75. Pull data into Jenkins, Bamboo ...
  • 76. Making Quality a first-class citizen „Too hard“ „we‘ll get round to this later“ „not cool enough“
  • 77. Questions and/or Demo Slides: slideshare.net/grabnerandi Get Tools: bit.ly/dttrial YouTube Tutorials: bit.ly/dttutorials Contact Me: agrabner@dynatrace.com Follow Me: @grabnerandi Read More: blog.dynatrace.com
  • 78. Andreas Grabner Dynatrace Developer Advocate @grabnerandi http://blog.dynatrace.com

Notas del editor

  1. More detailed stories can also be found on our blog: http://blog.dynatrace.com All examples have been found using Dynatrace Free Trial – http://bit.ly/dttrial
  2. Everyone has a SafeHarbor Statement – thats mine 
  3. Yes – I am working for a tool vendor – BUT – you can try this with most of the tools in the APM, Tracing, Diagnostics space out there.
  4. Your chance to leave now in case you think this session is about optimzing your java code by 0.01ms
  5. Its about looking at common performance metrics and trying to figure out why your application really doesnt scale or perform
  6. We will start at the frontend but spend most time on the backend. Its important though to look at both sides
  7. And that’s my professional background – and the reason why I think I have something to say about performance
  8. People send me data and I analyze it for them
  9. This is a sample of what I send people back -> thats the input to many stories I have to tell
  10. Based on my experience 80% of the problems are only caused by 20% problem patterns. And focusing on 20% of potential problems that take away 80% of the pain is a very good starting point
  11. Most of the problems can easily be identified by just looking at the right metrics. Most performance problems can also be found by looking at metrics while your app is not even under load -> a simple click through / functional / unit or integration test will do
  12. Lets start with the Frontend for all Web Developers
  13. http://httarchive.org – provides a good reference on how the top million websites in the world are constructed and whether they adhere to well known web performance best practices
  14. Especially interesting some of the advanced metrics like DOM Depth, Connections per Page or # of DOM Elements
  15. Here is an example I recently worked on – an online casino that had a very bad deployment coming up. Two metrics from WPO (Web Performance Optimization) that should have been seen in dev & test before releasing this to prod
  16. My all time favorite is the mobile landing page for a softdrink company during SuperBowl 2014 – 400+ individual images of selfie uploads aligned in a 20x20 grid. Pushed to my iPhone 4 in very high resolution causing 20MB data download and my phone to shrink each picture to be shown in a 20x20 grid on my small display
  17. Another common problem are individual very large images – or in this case a very large favicon which should normally only be a couple of bytes
  18. Or people forgetting to shrink their high resolultion images before putting it on public websites
  19. In case you didnt know – Hit F12 in your browser and you get all these metrics. Even better – you can automate that while running your browser driven tests
  20. Make sure deployments are done right – this is another example of pepsi having a certificate issue for some of their pages on the austrian website
  21. What everybody should have at least as a minimum is availability monitoring -> lots of free or cheap offerings out there to do that!!
  22. Use tools like Yslow to do the basic deployment checks
  23. You want to also avoid problems with your 3rd party or CDN providers – like in this case most images from Pepsi are not delivered by Amazons CDN
  24. If you depend on 3rd parties it is worth checking out whether these 3rd parties are always available -> helps you make the right decision when choosing between different providers -> look at their track record
  25. Lots of online outage services available
  26. If you have a peak period coming up – consider switching to an optimized landing page for that period – just as GoDaddy did during the SuperBowl.
  27. Now to the backend
  28. This story is from Joe – a DB guy from a very large telco arguing with his developers over performance problems of an online room reservation system which has evolved from a small project implemented by an intern to an application that is now used in their entire organization
  29. Devs buillt custom monitoring to proof their point! Contradicting what Joe‘s DB Tools had to say
  30. Reading this Transaction Flow showed what the real problem was: Loading Too Much Data from the Database causing High Memory Usage and therefore high CPU to cleanup the garbage
  31. Every SQL was executed on its on Connection
  32. The intern back then implemented its own OR Mapper by loading the full database content into a HashTable using individual queries
  33. Everybody seems to migrate to MicroServices -> but be aware of the common mistakes
  34. This is a monolithic app that was „migrated“ to microservices. The key use case is searching for sports clubs in a certain geographic area. A search that produces 33 search results used to take about 1s before „The Migration To MicroServices“. Now it takes 26.7s. AS you can see in the transaction flow there are many Issues: Architectural Violation, 1+N Query Problem but now between service calls as well as requesting too much static data redundantely from the database
  35. Another example with an even more dramatic impact on the infrastructure
  36. Thanks toi Splunk, Elastic Search and others we are able to analyze every log message we put out – but – does this really make sense?
  37. When logging becomes your performance issue -> misconfiguration of frameworks lead to CPU and I/O issues -> be aware of that!
  38. Wrong Log level and outdated log libraries can lead to serious performance impacts
  39. Now – response time should not be the only performance indicator
  40. Is this a successful deployment? If you look at Response Time and Throughput it is!
  41. But if CPU and Memory increases that dramatically it is NOT a good deployment -> this means a lot of extra costs!!
  42. Look at Heap Generations and Time spent in GC
  43. In this case it was a configuration mistake in their Dependency Injection Configuration. Objects got bloated causing more objects and larger objects on the heap
  44. If you dont monitor memory for every build you may need to go back in time – rerun all your tests for every build – to figure out what the change in configuratoin caused this problem
  45. Another classical Memory Leak and how easy it is to observe it! – In this case it was a memory leak in Tibco‘s Messaging Platform
  46. I love looking at Layers / APIs / Services -> if you have the chance to run a load test with slightly increasing load just monitor which of your APIs/Services/Methods behaviors „out of the norm“ -> thats your breaking point
  47. I always look at Exceptions vs Log Messages. Especially with frameworks such as Hibernate/Spring you can end up with a lot of „internal exceptions“ that impact performance but there is no „visible“ entry in any log file. Thats why I chart them and assume they correlate. If not – you know that something is wrong
  48. Same is true for Failed Requests vs. Load -> at which point does your app break and return HTTP 4xx, 5xx?
  49. Looking at Avg number of SQL Queries -> Do we have a data driven problem? Looking at Total # of SQL -> should show a flatten curve as we assume we can cache some of the data
  50. Are we preparing SQLs – how many INSERTS, UPDATES, DELETES -> do we have certain periods during the day when heavy REPORTS or clean up jobs run?
  51. Keep an eye on your pools. Not only Datbase but also Thread and network connectoin pools
  52. If you are automating your build pipeline you shoudl also automate your performance checks – find all these problems I just told you about
  53. Its about time to look at more than functionality – also look at whats „underneath the cover“
  54. If you do this you can simply let tools such as Dynatrace, NewRelic, AppDynamics, ... Analyze the code execution of your unit, integration or API tests and find any architectural regressions introduced by a code change
  55. This is how this can look like in a real life example. Analyzing Key Performance, Scalability and Architectural Metrics for every single test
  56. Viewing data number of bad quality tests per build
  57. And of course – bring it into Jenkins
  58. Help us make the world a better quality place so that you are not the one behind news like this 