the 80/20 rule: top purepath problem patterns of 2015! · the 80/20 rule: top purepath problem...

50
1 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015 Andreas Grabner, Performance Advocate The 80/20 Rule: Top PurePath Problem Patterns of 2015!

Upload: others

Post on 23-Jul-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

1 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

Andreas Grabner, Performance Advocate

The 80/20 Rule: Top PurePathProblem Patterns of 2015!

Page 2: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

2 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

Where do your

Stories come

from?

Page 3: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

3 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

#1: Real Life & Real User Stories

Page 4: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

4 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

#2: http://bit.ly/sharepurepath

Page 5: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

5 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

#3: http://bit.ly/onlineperfclinic

Page 6: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do
Page 7: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

20%

80%

Page 8: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

8 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE8

Frontend PerformanceWe are getting FATer!

Page 9: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do
Page 10: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do
Page 11: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

11 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

Make F12 or Browser Agent your friend!

Page 12: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

12 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

Online Tools for you!

Dynatrace Performance Center

www.dynatrace.com

PageSpeed Insights

developers.google.com/speed

Page 13: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

13 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE13

Frontend AvailabilityBack to Basics Please!

Page 14: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do
Page 15: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do
Page 16: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do
Page 17: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

17 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

Online Services for you: Is it down right now?

Page 18: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

18 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

Online Services for you: Outage Analyzer

Page 19: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

19 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE19

Backend PerformanceThe Usual Suspects

Page 20: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

• 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

Page 21: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

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!

Page 22: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

#1: Loading too much data24889! Calls to the

Database API!

High CPU and High Memory Usage to keep all

data in Memory

Page 23: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

#2: On individual connections 12444!individual

connections

Classical N+1 Query Problem

Individual SQL really <1ms

Page 24: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

#3: Putting all data in temp Hashtable

Lots of time spent in

Hashtable.get

Called from their Entity Objects

Page 25: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

• … you know what code is doing

• Challenge the developers

• Explore Tools that “might seem” out of your league!

• Built-In Database Analysis Tools

• “Logging” options of Frameworks such as Hibernate, …

• JMX, Perf Counters, … of your Application Servers

• Performance Tracing Tools: Dynatrace, NewRelic, AppDynamics, …

Lessons Learned – Don’t Assume …

Page 26: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

26 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE26

Backend PerformancePools and Queues

Page 27: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

Online Banking: Slow Balance Check

1.69m (=101s!) To Check Balance!

87% spent in IIS 600! SQL Executions

Page 28: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

#1 Time really spent in IIS?

Tip: Elapsed Time tells us WHEN a Method was executed!

Finding: Thread 32 in IIS waited 87s to pass control to Thread 30 in ASP.NET

Tip: Thread# gives us insight on Thread Queues / Switches

Page 29: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

#2 What about these SQL Executions?

Finding: EVERY SQL statement is executed on

ITS OWN Connection!

Tip: Look at “GetConnection”

Page 30: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

#2 SQL Executions! continued …

#1: Same SQL is executed 67! times

#2: NO PREPARATIONbecause everything

executed on new Connection

Page 31: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

Lessons Learned!

ASP.NET Worker Thread Pool Sizing!

DB Connection PoolsMore Efficient SQL

Page 32: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

32 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE32

Backend Performance(Micro)Services

Page 33: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

33 @Dynatrace

26.7sExecution 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

Page 34: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

34 @Dynatrace

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

Page 35: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

35 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE35

Tips & Tricks

Page 36: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

36 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

Tip: Web Server Health

Do we have enough WORKER THREADS on the

Web Server?

Sanity Check on BANDWIDTH requirements per Request

Can we handle the LOAD and BANDWIDTH requirements?

Page 37: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

37 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

Tip: App Server Health over TimeHow is the LOAD DISTRIBUTION

on that JVM/CLR?

Any MEMORY ISSUES?

Do we have enough WORKER THREADS?

Do we have enough CPU?

Page 38: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

38 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

Tip: Host Health over Time

Do we have ENOUGH RESOURCES on these hosts?

Which processes are consuming these

resources? Need to RE-DEPLOY processes?

Page 39: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

39 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

Tip: Layer Breakdown over Time

With increasing load: Which LAYER doesn’t SCALE?

Page 40: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

40 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

Tip: Exceptions and Log Messages

How are # of EXCEPTIONSevolving over time?

How many SEVERE LOG messages to we write in relation to Exceptions?

Page 41: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

41 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

Tip: Failed Transactions

Are more TRANSACTIONS FAILING (HTTP 5xx, 4xx, …)

under heavier load?

Page 42: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

42 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

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?

Page 43: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

43 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

Tip: Database History Dashboard

How many SQL Statements are PREPARED?

What’s the overall Execution Time of different SQL Types (SELECT, INSERT, DELETE, …)

Page 44: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

44 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

Tip: DB Connection Pool UtilizationDo we have enough DB

CONNECTIONS per pool?

Page 45: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

45 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

Tip: Group-By + Show All Options

Page 46: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

46 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

Tip: Advanced Filtering

Page 47: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

47 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

Memory, Thread, CPU Diagnostics

Page 48: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

48 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

Server Timeline Dashlet (Community Supported)

Page 49: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

49 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015

• http://bit.ly/onlineperfclinic

• http://bit.ly/dttutorials

• http://bit.ly/sharepurepath

• http://answers.dynatrace.com

• http://apmu.dynatrace.com

• Follow me: @grabnerandi

More Resources

Page 50: The 80/20 Rule: Top PurePath Problem Patterns of 2015! · The 80/20 Rule: Top PurePath Problem Patterns of 2015! 2 COMPANY CONFIDENTIAL –DO NOT DISTRIBUTE #Perform2015 Where do

50 COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE #Perform2015COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE