costs of bad performance
- electricity
- employee productivity
- lost business (e.g. slow pages)
- hard cash (e.g. trading)
- find the bottleneck in the application
- cpu → consistently high
- I/O → cpu not consistently high
- lock → cpu not consistently high
- space ??? cpu can be low or high ...
- what is the JVM doing? → tools … must have:
- visual indicators
- explanation
- suggested solution (command line)
- measure performance
- risk to make it worse
- get a baseline
- system must be as similar as possible to production
- how:
- System.currentTimeMillis()
- warm up your system
- JIT
- trigger caches
- for IBM jvm's
- free
- IBM Support Assistant: centralized repository for IBM tools
- diagnose:
- lower throughput
- crash (out-of-memory exception)
- trigger gc's → higher cpu
- tools:
- verbosegc: very low overhead → use on production
- live memory monitoring → IBM Monitoring & Diagnostic tools for Java
- GC and Memory Visualizer
- for Websphere → also works on Solaris & HP-UX (i.e. sun jvm syntax)
- heap details, including heap histogram
- get dominator tree
- search inefficiently used data structures & redundant data
- recommendations
- increase heap size
- gc takes between 10% - 20% cpu → tune gc policy
- Health Center
- agent in JVM
- client (IBM Support Assistant)
- visualize gc
- recommendations
- check gc performance
- GC and Memory Visualizer
- Memory Analyzer (not from IBM → eclipse.org): diagnose footprint issues:
- heapdumps
- automatically on out-of-memory
- trigger programmatically
- tool support is essentialµ
- heapdumps
- OS-tools
- track native memory: perfmon, vmstart, ps (os-specific)
- use gcmv to visualize os-specific dump
- some native structures have java-wrappers in the heap (e.g. Threads and NIO buffers)
- target your optimizations → measure
- diagnose:
- method trace:
- System.out.println()
- log4j
- ibm-jvm param -Xtrace:print=mt,methods=(HW*)
- method profiler:
- health center: low overhead sampler
- method trace:
- gc and memory analyser → long gc times might indicate paging
- method trace for network and disk I/O
- os-specific tools
- sample thread dumps
- health center:
- lock analysis
- identify contended locks
No comments:
Post a Comment