open source performance monitoring tools, tips and tricks for java
DESCRIPTION
Open Source Performance Monitoring Tools, Tips and Tricks for Java. Matt Secoske Consultant - Bass & Associates http://www.bass-inc.com email: [email protected]. Planning Process Tools Tips, Tricks. Agenda. Where does performance matter?. ... where your business requires it. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/1.jpg)
Open Source Performance Monitoring Tools, Tips and Tricks for Java
Matt SecoskeConsultant - Bass & Associates
http://www.bass-inc.com
email: [email protected]
![Page 2: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/2.jpg)
• Planning
• Process
• Tools
• Tips, Tricks
Agenda
![Page 3: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/3.jpg)
Where does performance matter?
![Page 4: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/4.jpg)
... where your business requires it.
![Page 5: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/5.jpg)
Why don't we treat this like a test case?
![Page 6: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/6.jpg)
1) Determine your performance goals
2) Create testing scenarios
3) Determine monitoring/profiling needs
4) Integrate into development process - continuous performance testing?
5) Integrate into production environment
Plan for Performance
![Page 7: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/7.jpg)
•Hardware (web, app, db servers)- CPU- Memory- Cache Hits/Misses- Disk/Network speed
• Java Specific- GC- Application specific metrics
What to monitor
![Page 8: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/8.jpg)
• Load Testing / Driving
• Logging / Log Analysis
•Contained Profiling (Profiler wraps Application)
• External Profiling (JVMPI)
• java.lang.instrumentation
Profiling Tools
![Page 9: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/9.jpg)
•Decorates existing JUnit tests
•Great for running benchmarks against a particular test case (or cases) while refactoring.
•Not so great as an over-all monitoring solution
JUnitPerf
![Page 10: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/10.jpg)
•Clusterable performance testing
• Stress, Load, Capacity and Functional Testing
•HTTP, Web Services, RPC, JMS, JUnit,
• Proxy for recording traffic (real users)
• Scriptable in Jython
The Grinder
![Page 11: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/11.jpg)
Load Testing – Apache JMeter
![Page 12: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/12.jpg)
• Easy
•Common (Web server logs)
• Affects environment (file I/O)
• Affects code
•Generally solved by N.I.H. code
• Accuracy
Log files / Analysis
![Page 13: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/13.jpg)
Log4J or other logging tool +Aspects =simple, transparent, targeted
Logging Tools
![Page 14: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/14.jpg)
•Handcarved (AspectJ, AspectWerkz)
• Java Interactive Profiler
•GlassBox Inspector
Aspect-based Logging Tools –
![Page 15: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/15.jpg)
GlassBox Inspector
![Page 16: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/16.jpg)
• Sun's new JVM profiling tool
• Part of NetBeans Profiler extension
• Local or Remote Profiling
• Limited JVM support (mainly 5.0+)
JFluid / NetBeans Profiler
![Page 17: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/17.jpg)
NetBeans Profiler
![Page 18: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/18.jpg)
• Test and Performance Tools Platform
• Local or remote profiling
•Requires JVM agent for remote
Eclipse TPTP
![Page 19: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/19.jpg)
Eclipse TPTP
![Page 20: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/20.jpg)
• Treat performance as a test casered bar – green bar – refactor
•Real-world data + Real-world usage patterns = accurate benchmarks
• Put in just enough metrics to get your performance measurements
• Performance Test != Production
• Keep some monitoring in production
Tips, Tricks
![Page 21: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/21.jpg)
• Performance Monitoring, like most things in software development, is an iterative process.
• Initial setup will take longer than expected. Its worth it.
• “Premature optimization is the root of all evil” - Hoare, Knuth
• Know when and what to optimize – comes from experience and profiling
•Make performance a part of your development process
Final Thoughts
![Page 22: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/22.jpg)
JMeter: http://jakarta.apache.org/jmeter
The Grinder: http://grinder.sf.net
JUnitPerf: http://clarkware.com/software/JUnitPerf.html
Log4J: http://logging.apache.org/log4j/docs/
GlassBox Inspector: https://glassbox-inspector.dev.java.net/
Java Interactive Profiler: http://jiprof.sourceforge.net/
NetBeans Profiler: http://www.netbeans.org/products/profiler/index.html
Eclipse TPTP: http://www.eclipse.org/tptp/
Links - Tools
![Page 23: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/23.jpg)
“Add Object Cache Monitoring using JMX and Aspects” - Srini Penchikala
http://www.devx.com/Java/Article/29526
“Build your own profiling tool” - Andrew Wilcox
http://www-128.ibm.com/developerworks/java/library/j-jip/?ca=dgr-lnxw01JavaProfiling
“Performance monitoring with AspectJ, Part 1” - Ron Bodkin
http://www-128.ibm.com/developerworks/java/library/j-aopwork10/
“Continuous Performance Testing with JUnitPerf” - Mike Clark
http://www.javapronews.com/javapronews-47-20030721ContinuousPerformanceTestingwithJUnitPerf.html
Links - Articles
![Page 24: Open Source Performance Monitoring Tools, Tips and Tricks for Java](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813b77550346895da4889a/html5/thumbnails/24.jpg)