Practical Enterprise Java Performance Tuning<br />Matt Brasier<br />Principal Consultant, C2B2 Ltd<br />
Agenda<br />Introduction<br />Performance tuning toolbox<br />Examples<br />Summary<br />
Introduction<br />Who Am I?<br />Matt Brasier<br />Principal Consultant at C2B2 Consulting<br />10 years Java EE experienc...
Introduction<br />This talk<br />Introduction to tools used<br />Practical demonstrations<br />Download the example applic...
Performance consultant’s toolbox<br />
JBoss admin console<br />
JBoss admin console<br />http://localhost:8080/admin-console<br />Since JBoss 5<br />Cut-down version of RHQ<br />
JBoss jmx-console<br />
JBoss jmx-console<br />http://localhost:8080/jmx-console<br />Dynamic view of JMX mbeans<br />Information overload<br />Fa...
VisualVM<br />
VisualVM<br />Distributed with JDK 6<br />Successor to jconsole<br />Install all the plugins!<br />jvisualvm from the comm...
Command line JDK tools<br />jps<br />Process IDs of Java processes<br />jstat<br />JVM statistics for things such as GC<br...
Testing Tools<br />
JMeter<br />
JMeter<br />http://jakarta.apache.org/jmeter/<br />Load testing tool<br />Easy to produce scripts<br />Can record scripts ...
The Grinder<br />
The Grinder<br />http://grinder.sourceforge.net/<br />Load testing tool<br />More complex scripts than Jmeter<br />Jython ...
Live Demo<br />
Summary<br />The JVM and JMX make a lot of information available<br />The tools to get at the information are readily avai...
Hot method<br />Repeated Thread dumps reveals one method appears frequently<br />It is either occuring a lot or running sl...
System.gc<br />Frequent major garbage collections<br />jstat shows a large GCT and System.gc as the previous GC cause<br /...
Synchronization<br />Thread dump reveals large number of threads blocked waiting for the same lock<br />
Key techniques<br />Load testing<br />Thread dumps<br />Visual VM<br />Swiss army knife of Java consultants<br />
Questions?<br />
Thank you<br />
Upcoming SlideShare
Loading in …5
×

JudCon 2010 Berlin: Practical Enterprise Java Performance Tuning

938 views
896 views

Published on

presentation by

Matt Brasier
Head of Consulting, C2B2 Ltd

1 Comment
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total views
938
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
31
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

JudCon 2010 Berlin: Practical Enterprise Java Performance Tuning

  1. 1.
  2. 2. Practical Enterprise Java Performance Tuning<br />Matt Brasier<br />Principal Consultant, C2B2 Ltd<br />
  3. 3. Agenda<br />Introduction<br />Performance tuning toolbox<br />Examples<br />Summary<br />
  4. 4. Introduction<br />Who Am I?<br />Matt Brasier<br />Principal Consultant at C2B2 Consulting<br />10 years Java EE experience<br />6 years as a consultant<br />
  5. 5. Introduction<br />This talk<br />Introduction to tools used<br />Practical demonstrations<br />Download the example application<br />www.c2b2.co.uk/judcon/sampleapp.zip<br />
  6. 6. Performance consultant’s toolbox<br />
  7. 7. JBoss admin console<br />
  8. 8. JBoss admin console<br />http://localhost:8080/admin-console<br />Since JBoss 5<br />Cut-down version of RHQ<br />
  9. 9. JBoss jmx-console<br />
  10. 10. JBoss jmx-console<br />http://localhost:8080/jmx-console<br />Dynamic view of JMX mbeans<br />Information overload<br />Fast if you know what you are looking for<br />A few really useful features<br />
  11. 11. VisualVM<br />
  12. 12. VisualVM<br />Distributed with JDK 6<br />Successor to jconsole<br />Install all the plugins!<br />jvisualvm from the command line<br />
  13. 13. Command line JDK tools<br />jps<br />Process IDs of Java processes<br />jstat<br />JVM statistics for things such as GC<br />jstack<br />Thread dumps<br />jhat<br />Heap dump analysis<br />
  14. 14. Testing Tools<br />
  15. 15. JMeter<br />
  16. 16. JMeter<br />http://jakarta.apache.org/jmeter/<br />Load testing tool<br />Easy to produce scripts<br />Can record scripts from a browser<br />Can run in distributed mode<br />
  17. 17. The Grinder<br />
  18. 18. The Grinder<br />http://grinder.sourceforge.net/<br />Load testing tool<br />More complex scripts than Jmeter<br />Jython based<br />Better for extreme testing<br />
  19. 19. Live Demo<br />
  20. 20. Summary<br />The JVM and JMX make a lot of information available<br />The tools to get at the information are readily available<br />All that you have to do is understand what it is telling you<br />
  21. 21. Hot method<br />Repeated Thread dumps reveals one method appears frequently<br />It is either occuring a lot or running slowly<br />
  22. 22. System.gc<br />Frequent major garbage collections<br />jstat shows a large GCT and System.gc as the previous GC cause<br />VisualVM shows large proportion of CPU time spent garbage collecting<br />
  23. 23. Synchronization<br />Thread dump reveals large number of threads blocked waiting for the same lock<br />
  24. 24. Key techniques<br />Load testing<br />Thread dumps<br />Visual VM<br />Swiss army knife of Java consultants<br />
  25. 25. Questions?<br />
  26. 26. Thank you<br />

×