open source performance monitoring tools, tips and tricks for java

24
Open Source Performance Monitoring Tools, Tips and Tricks for Java Matt Secoske Consultant - Bass & Associates http://www.bass- inc.com email: [email protected]

Upload: nirav

Post on 06-Jan-2016

44 views

Category:

Documents


1 download

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 Presentation

TRANSCRIPT

Page 1: Open Source Performance Monitoring Tools, Tips and Tricks for Java

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

• Planning

• Process

• Tools

• Tips, Tricks

Agenda

Page 3: Open Source Performance Monitoring Tools, Tips and Tricks for Java

Where does performance matter?

Page 4: Open Source Performance Monitoring Tools, Tips and Tricks for Java

... where your business requires it.

Page 5: Open Source Performance Monitoring Tools, Tips and Tricks for Java

Why don't we treat this like a test case?

Page 6: Open Source Performance Monitoring Tools, Tips and Tricks for Java

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

•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

• 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

•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

•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

Load Testing – Apache JMeter

Page 12: Open Source Performance Monitoring Tools, Tips and Tricks for Java

• 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

Log4J or other logging tool +Aspects =simple, transparent, targeted

Logging Tools

Page 14: Open Source Performance Monitoring Tools, Tips and Tricks for Java

•Handcarved (AspectJ, AspectWerkz)

• Java Interactive Profiler

•GlassBox Inspector

Aspect-based Logging Tools –

Page 15: Open Source Performance Monitoring Tools, Tips and Tricks for Java

GlassBox Inspector

Page 16: Open Source Performance Monitoring Tools, Tips and Tricks for Java

• 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

NetBeans Profiler

Page 18: Open Source Performance Monitoring Tools, Tips and Tricks for Java

• 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

Eclipse TPTP

Page 20: Open Source Performance Monitoring Tools, Tips and Tricks for Java

• 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

• 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

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

“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