Más contenido relacionado La actualidad más candente (20) Similar a Java Performance Engineer's Survival Guide (20) Más de Monica Beckwith (8) Java Performance Engineer's Survival Guide8. 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)!
9. ©2016 CodeKaram8
• Document, understand and prioritize SLAs
• Throughput
• Responsetime
• Capacity
• Footprint
• CPU utilization?
• …
Define Success!
29. ©2016 CodeKaram28
• Application services
• Application server
• Database
• Any other services in the ecosystem?
Application Performance Analysis
Application Ecosystem
Application
30. JVM + Runtime Performance Analysis
©2016 CodeKaram29
JRE
JVM
• Classloading stats
• JIT Compilation stats
• Garbage Collection stats
• Threads stats
32. Hardware Performance Analysis
©2016 CodeKaram31
• Memory bandwidth/ traffic/ consumption
• CPU/ core utilization
• CPU cache efficiency/ utilization/ levels
• Architectural specific?
• IO Stats
Hardware
35. Top Down Approach - Process
•Step 1Monitor
•Step 2 Profile
•Step 3Analyze
•Step 4 Tune +
Apply
©2016 CodeKaram34
38. Bottom Up Approach - Process
•Step 1Monitor
•Step 2 Profile
•Step 3Analyze
•Step 4 Tune +
Apply
©2016 CodeKaram37
49. ©2016 CodeKaram48
• Tools?
• VisualVM, Java Flight Recorder
• PrintCompilation, PrintGCDetails (+PrintGCDateStamps), jmap –
clstats, jcmd GC.class_stats
Step 1: Monitor
50. ©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
51. 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
52. ©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
53. 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
54. 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
55. 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
60. Where to Start?
©2016 CodeKaram59
• Know what you are stressing
• Get/ write the appropriate workload/ application
• Get/write the appropriate tools
61. 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
62. 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
63. 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
64. Where to Next?
©2016 CodeKaram63
• Know what you are stressing
• Get/ write the appropriate workload/ application
• Get/write the appropriate tools