StLouisJavaUserGroupx

Download Report

Transcript StLouisJavaUserGroupx

Web/App Performance
How to keep you out of the News
Tech Blogs on http://blog.dynatrace.com
Free Tools on http://ajax.dynatrace.com
Hosted by: Jeff Fynboh
1
@Dynatrace
WHY we are
here
TODAY…
2
@Dynatrace
Nobody wants this …
3
@Dynatrace
Unless you work for
Google or Microsoft 
4
@Dynatrace
Nor this …
5
@Dynatrace
6
@Dynatrace
As it leads to this …
7
@Dynatrace
The “War Room”
Facebook – December 2012
8
@Dynatrace
And potentially to this …
9
@Dynatrace
10
@Dynatrace
And this …
11
@Dynatrace
12
@Dynatrace
And that’s why Business
doesn’t like it either …
13
@Dynatrace
YES we know this
80% Dev Time in Bug Fixing
$60B Defect Costs
BUT
~
80%
caused by
14
of problems
~20%
patterns
@Dynatrace
5 Situations on
WHY this happened,
HOW to avoid it
15
@Dynatrace
16
@Dynatrace
#Push
without a Plan
17
@Dynatrace
Mobile Landing Page of Super Bowl Ad
Total size of ~
20MB
434 Resources in total on that page:
230 JPEGs, 75 PNGs, 50 GIFs, …
18
@Dynatrace
m.store.com redirects to www.store.com
ALL CSS and JS files are
redirected to the www domain
19
This is a lot of time “wasted”
especially on high latency mobile
connections
@Dynatrace
Fifa.com during Worldcup
http://apmblog.compuware.com/2014/05/21/is-the-fifa-world-cup-website-ready-for-the-tournament/
20
@Dynatrace
# Images
# Redirects
Size of Resources
21
@Dynatrace
22
@Dynatrace
#“Blindly”
(Re)use Existing
Components
23
@Dynatrace
Requirement: We need a report
24
@Dynatrace
Using Hibernate results in 4k+ SQL Statements to
display 3 items!
Hibernate
Executes 4k+
Statements
Individual
Execution VERY
FAST
But Total SUM
takes 6s
25
@Dynatrace
# SQL Executions
# of SAME SQLs
26
@Dynatrace
27
@Dynatrace
Architectural
Decisions gone
Bad
28
@Dynatrace
Project: Online Room Reservation System
• 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
29
@Dynatrace
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!
30
DB Tool says:
Avg. SQL Query: <1ms!
@Dynatrace
#1: Loading too much data
24889! Calls to the
Database API!
High CPU and High
Memory Usage to keep all
data in Memory
31
@Dynatrace
#2: On individual connections
12444!
individual
connections
Individual SQL
really <1ms
Classical N+1
Query Problem
32
@Dynatrace
33
@Dynatrace
Don’t assume
You know the
environment
34
@Dynatrace
Distance Calculation Issues
Solution: Unit Test in
Live App reports Geo
Calc Problems
480km biking
in 1 hour!
35
Finding: Only
happens on certain
Android versions
@Dynatrace
3rd Party Issues
Impact of bad
3rd party calls
36
@Dynatrace
# Functional
Errors
rd
3 Party calls
37
@Dynatrace
38
@Dynatrace
Deployment
gone bad
39
@Dynatrace
Test Environment
Production Environment
8x slower
3x more SQL
40
@Dynatrace
Test Environment
That’s Normal:
Having I/O for Web
Request as main
contributor
Production Environment
Hibernate,
Hibernate,
Classloading,
XML
–Classloading,
The Key Hotspots
I/O–for
WebKey
XML
The
Requests
doesn’t
Hotspots
even show up!
41
@Dynatrace
Top Contributor
Class.getInterfaces
Called from Hibernates
FieldInterceptionHelper
These calls all originate
from thousands of calls to
find item by code
42
@Dynatrace
Time Spent in API
# Calls into API
43
@Dynatrace
44
@Dynatrace
#No “Agile”
Deployment
45
@Dynatrace
Ad on air
Load Spike resulted in Unavailability
46
@Dynatrace
Alternative: “GoDaddy goes DevOps”
1h before
SuperBowl KickOff
47
1h after
Game ended
@Dynatrace
# of Domains
Total Size
48
@Dynatrace
Consider these Metrics
• # Images
• Time Spent in API
• # Redirects
• # Calls into API
• Size of Resources
• # Functional Errors
• # SQL Executions
• 3rd Party calls
• # of SAME SQLs
• # of Domains
• # Items per Page
• Total Size
• # AJAX per Page
49
@Dynatrace
(R)Evolutionize Web Performance Optimization
Unit & Integration Tests
Commit Stage
•
•
•
•
Compile
Execute Unit Test
Code Analysis
Build installers
Automated
Acceptance
Testing
Performance Tests
Automated
Capacity
Testing
Production
Monitoring
Manual testing
• Key showcases
• Exploratory testing
Release
Functional Tests
50
@Dynatrace
51
@Dynatrace
Example from Web Diagnostics
9.68MB Page Size
282! Objects
on that page
8.8s Page Load
Most objects are images
delivered from your main
domain
Time
Very long Connect time
(1.8s) to your CDN
52
@Dynatrace
Example from Server-Side Diagnostics
526s to render that
report
1 SQL running
210s!
Lots of time spent
in logging to Log4J
Lots of time spent
in rendering
53
@Dynatrace
Online Performance Clinics
Every Other week @
bit.ly/onlineperfclinic
54
@Dynatrace
“Share Your PurePath”
bit.ly/sharepurepath
Your Benefits
55
My Benefits
• Free Performance Review
• More blog material for next year 
• Extended Dynatrace License
• Gratification that I could help you
@Dynatrace
Questions and/or Demo
Get Tools: http://ajax.dynatrace.com
YouTube Tutorials: http://bit.ly/dttutorials
Live Q&A Sessions: http://bit.ly/onlineperfclinic
Contact Me: [email protected]
Read More: http://blog.dynatrace.com
56
@Dynatrace