docker/devops meetup: metrics-driven continuous performance and scalabilty

76
1 @Dynatrace Application Quality Metrics for your Pipeline (and why Docker is not the solution to all of your problems) Andreas (Andi) Grabner - @grabnerandi Metrics-Driven DevOps

Upload: andreas-grabner

Post on 13-Jan-2017

1.173 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

1 @Dynatrace

Application Quality Metrics for your Pipeline(and why Docker is not the solution to all of your problems) Andreas (Andi) Grabner -

@grabnerandi

Metrics-Driven DevOps

Page 2: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty
Page 3: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty
Page 4: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

700 deployments / year

10 + deployments / day

50 – 60 deployments / day

Every 11.6 seconds

Page 5: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

Example #1: Online Casino 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

Page 6: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

879! SQL Queries8! Missing CSS & JS Files

340! Calls to GetItemById

Example #2: Lawyer Website based on SharePoint

11s! To load Landing Page

Page 7: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty
Page 8: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty
Page 9: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty
Page 10: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

• Waterfall Agile: 3 years• 220 Apps - 1 deployment per month

“EVERYONE can do Continuous Delivery”

“Every manual tester does AUTOMATION”“WE DON’T LOG BUGS – WE FIX THEM!”

Measures Built-In, Visible to EveryonePromote your Wins, Educate your Peers

Page 11: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

Challenges

Page 12: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

Deploy Faster!!

Page 13: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

Fail Faster!?

Page 14: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty
Page 15: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty
Page 16: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

Its not about blind automation of pushing more bad code through a shiny pipeline

Page 17: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

Metrics based

Decisions!

Page 18: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

Time of D

eployment

Availability dropped to 0%

Page 19: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

Bad Deployment based on Resource Consumption

Page 20: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

With increasing load: Which LAYER doesn’t SCALE?

Page 21: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

Usage by Channel? Errors on Devices?

Page 22: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

App with Regular Load supported by

10 Containers

Twice the Load but 48 (=4.8x!) Containers! App doesn’t scale!!

Page 23: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

Technical Debt!

Page 24: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

80%$60B

Page 25: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

Insufficient Focus on Quality

Page 26: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

The “War Room”

Facebook – December 2012

Page 27: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty
Page 28: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

20%80%

Page 29: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty
Page 30: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

I learning from

others

Page 31: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

4 use cases WHY did it happen? HOW to avoid it! METRICS to guide you.

Page 32: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty
Page 33: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

#1 : Not every Architect

makes good decisions

Page 34: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

• 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 35: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

Developers built own monitoringvoid 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 36: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

#1: Loading too much data24889! Calls to the Database

API!

High CPU and High Memory Usage to keep all data in Memory

Page 37: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

#2: On individual connections 12444! individual

connections

Classical N+1 Query Problem

Individual SQL really <1ms

Page 38: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

#3: Putting all data in temp Hashtable

Lots of time spent in Hashtable.get

Called from their Entity Objects

Page 39: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

• … 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 …

Page 40: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

Key Metrics# of SQL Calls# of same SQL Execs (1+N)# of ConnectionsRows/Data Transferred

Page 41: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

41 @Dynatrace

Page 42: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

42 @Dynatrace

#2There is no easy "Migration" to Micro(Services)

Page 43: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

43 @Dynatrace

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

Page 44: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

44 @Dynatrace

Key Metrics# Service Calls, # Containers# of Threads, Sync and Wait # SQL executions# of SAME SQL’sPayload (kB) of Service Calls

Page 45: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

45 @Dynatrace

Page 46: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

46 @Dynatrace

#3don't ASSUME you

know the environment

Page 47: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

Distance calculation issues

480km biking in 1 hour!

Solution: Unit Test in Live App reports Geo

Calc Problems

Finding: Only happens on certain

Android versions

Page 48: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

3rd party issues

Impact of bad 3rd party calls

Page 49: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

49 @Dynatrace

Key Metrics# of functional errors# and Status of 3rd party callsPayload of Calls

Page 50: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

12 000 000 $

Page 51: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

51 @Dynatrace

#4Thinking Big?

Then Start Small!

Page 52: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

52 @DynatraceAvailability dropped to 0%

Load Spike resulted in UnavailabilityAd on air

Page 53: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

53 @Dynatrace

Alternative: “GoDaddy goes DevOps”

Response time improved 4x

1h before SuperBowl KickOff

1h after Game ended

Page 54: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

54 @Dynatrace

Key Metrics

# Domains

Total Size of Content

Page 55: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

55 @Dynatrace

What have we learned so far?

Page 56: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

56 @Dynatrace

1. # Resources2. Size of Resources3. Page Size4. # Functional Errors5. 3rd Party calls6. # SQL Executions7. # of SAME SQLs

MetricBased

DecisionsAre Cool

Page 57: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

We want to get from here …

Page 58: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

To here!

Page 59: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

Use these application metrics as additional Quality Gates

Page 60: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

60

What you currently measure

What you should measure

Quality Metrics in your pipeline # 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/5xxRequest/Response SizePage Load/Rendering Time…

Page 61: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

Extend your Continuous Integration

12 0 120ms3 1 68ms

Build 20 testPurchase OKtestSearch OK

Build 17 testPurchase OKtestSearch OK

Build 18 testPurchase FAILEDtestSearch OK

Build 19 testPurchase OKtestSearch OK

Build # Test Case Status # SQL # Excep CPU

12 0 120ms3 1 68ms

12 5 60ms3 1 68ms

75 0 230ms3 1 68ms

Test & Monitoring Framework Results Architectural Data

We identified a regresesion

Problem solved

Exceptions probably reason for failed testsProblem fixed but now we have an

architectural regressionProblem fixed but now we have an

architectural regressionNow we have the functional and architectural confidence

Let’s look behind the scenes

Page 62: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

#1: Analyzing every Unit & Integration test

#2: Metrics for each test

#3: Detecting regression based on measure

Unit/Integration Tests are auto baselined! Regressions auto-detected!

Page 63: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

Build-by-Build Quality ViewBuild Quality Overview in

Dynatrace or JenkinsBuild Quality Overview in

Dynatrace & your CI server

Page 64: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

Production Data: Real User & Application Monitoring

Page 65: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty
Page 66: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty
Page 67: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty
Page 68: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

Recap!

Page 69: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

#1: Pick your App Metrics

# of Service Calls Bytes Sent & Received

# of Worker Threads

# of Worker Threads

# of SQL Calls, # of Same SQLs # of DB

Connections

# of SQL Calls, # of Same SQLs # of DB

Connections

Page 70: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

#2: Figure out how to monitor themhttp://bit.ly/dtpersonal

Page 71: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

#3: Automate it into your Pipeline

Page 72: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

#4: Also do it in Production

Page 73: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

Better Software,

Faster!!

Page 74: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

Draw better Unicorns

Page 75: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

75 @Dynatrace

Questions and/or DemoSlides: slideshare.net/grabnerandiGet Tools: bit.ly/dtpersonalYouTube Tutorials: bit.ly/dttutorialsContact Me: [email protected] Me: @grabnerandiRead More: blog.dynatrace.com

Page 76: Docker/DevOps Meetup: Metrics-Driven Continuous Performance and Scalabilty

76 @Dynatrace

Andreas GrabnerDynatrace Developer Advocate@grabnerandihttp://blog.dynatrace.com