Book Review: Java EE 7 Performance Tuning and Optimization
Join the DZone community and get the full member experience.Join For Free
this is a review of the book java ee 7 performance tuning and optimization
what is this book about?
as the title clearly suggests, this book deals with performance tuning. it focuses on tuning, monitoring and optimizing the performance of java ee applications in particular.
it starts off with basics of performance tuning and gives us an insight into the various kinds of performance related issues which one might face in the context of enterprise grade, distributed web (java ee) applications. the book provides a quick fire tour of java ee 7 , familiarizes the reader with the basics of jvm (memory model, garbage collection. concurrency) and dives into the nitty-gritty of performance testing in java.
the author guides us through some common performance issues and their symptoms along with a detailed insight of java monitoring and profiling tools (in the jdk, ides etc). topics like cpu , memory and thread profiling have dedicated chapters and have been covered in great detail. the book delves into the topics of tuning a java ee application and its various facets (jvm, app server, web server, the os) along with a primer on designing high performance java ee applications. last but not the least, the reader can dig into some performance tuning tips (ejb, jpa, servlets, jsf, java se) and apply the knowledge gained from the book in tuning a sample java ee application hands-on!
who has written this book?
the book has been authored by osama oransa . more about him here
what does the book cover?
the book is well organized and divided into twelve chapters. let’s take a peek and see what each one has to offer.
chapter 1 – getting started with performance tuning
this chapter introduces us to the world of java ee performance tuning.
- classifies different types of performance related issues based on phases of discovery.
- it goes on to differentiate typical application modes (standalone, thick and thin) along with a brief summary
- provides a quick peek into the all the components/layers of web applications and their properties which are critical from a performance standpoint – from the client end right down to the db server
all in all, this lesson does a great job of getting things rolling and setting up the reader for what’s coming next. this is of great value for someone who is relatively new to the concept of performance tuning and monitoring and allows her to get a decent head start.
chapter 2 – understanding java fundamentals
it lays a strong emphasis on strengthening the fundamentals associated with the java platform which are directly related to performance. two primary topics which are covered are the jvm fundamentals and java ee 7 (yes!)
- discussion of the jvm memory structure (as laid out by the jvm specification) and details around the java hotspot vm .
- exploration of the jvm garbage collector and its policies
- provides a brief overview of java ee 7 – its specifications and features
- delves into some of the concurrency constructs available in java ee – async invocations, singleton beans, non blocking i/o etc
chapter 3- getting familiar with performance testing
chapters 1 and 2 provided a good foundation and this chapter builds upon it. it deals with performance testing on a whole
- it explores different facets of performance testing like types, components, tools, benchmarking etc along with an explanation of common testing terminologies and a discussion around performance testing in a cloud environment.
- the rest of the chapter deals with apache jmeter and thoroughly covers web service, web application and database scripts with the help of succinct examples.
chapter 4 – monitoring java applications
this chapter deals with in depth coverage of the tools associated with performance monitoring and profiling in depth.
- starts off with an overview of the jdk monitoring and profiling tools landscape
- it delves into details of these tools – memory map and heap analysis tools, jvisual vm and oracle java mission control
- the netbeans and eclipse are covered as a part of the section which deals with ide capabilities for jvm monitoring and profiling.
- the chapter ends with a tour of jprofiler with a focus on the offline profiling mode.
chapter 5 – recognizing common performance issues
this chapter builds on the performance issues overview provided in chapter 1. it brings into focus, some of the frequently occurring performance issues and briefly looks at each of them
- explores threading and deadlock related issues
- discusses performance issues which can be attributed to to memory (leakage), improper use of remote calls, database performance etc
chapter 6 – cpu time profiling
this chapter deals takes up one of the key aspects in java profiling – cpu time profiling
- discusses three profilers – netbeans native profiler, the java mission control and jprofiler
- explains how to interpret and make sense of the results obtained from the profiler tools
- delves into pin pointing and identification of performance issues (algorithm related, caching, threading etc) and provides a recipe/strategy for fixing them.
chapter 7 – thread profiling
the deep dive into java profiling continues. this time, the focus is one thread profiling and its related nuances
- as was the case with cpu time profiling, the thread profiling options are explored with the help of netbeans, java mission control as well as jprofiler
- explains how to extract thread dumps with the help of jdk, application server and various profiler tools
- deals with interpretation of thread profiling results and analyzing thread dumps
- deep dive into exploration of threading related issues such as deadlock, blocked threads, unmanaged threads etc and builds on the recipe for fixing such issues (from the previous lesson)
chapter 8 – memory profiling
this chapter marks the last section of the in-depth coverage of the types of profiling and deals with the all important area of memory profiling
- how to use the netbeans profiler and the jprofiler for memory profiling
- explains the process of heap dump extraction using a variety of tools such as jmap , jvisual vm, eclipse mat , jprofiler etc
- guides us through the process of heap dump analysis using visual tools as well as via he oql (object query language)
- analyses the potential issues emerging from memory related roots
chapter 9 – tuning an application’s environment
after all the discussion and exploration about potential performance related issues, related profiling tools and possible remediation, the focus now shifts to tuning. this chapter deals with application environment tuning is specific which is divided into distinct categories
- detailed exploration of jvm tuning including both hotspot and jrockit
- deep dive into application server tuning with glassfish and oracle weblogic being the prime examples. talks about tuning components such as ejb and web containers, jdbc pools, thread pools etc
- exploration of http server tuning with the help of apache and oracle http server
- discusses tuning and optimization of operating system and hardware (capacity planning) related components
chapter 10 – designing high-performance enterprise applications
as the name clearly suggests, the chapter looks at the design aspects of enterprise applications. after having discussed different facets of performance tuning/monitoring/profiling, it makes sense to try and understand how to put certain best practices to practical use.
- explores different set of design decisions (app layer, security, framework etc) and their probable impact and introduces some common anti-patterns as well
- provides good insight/analysis of soa and roa based architectures and their performance aspects
- discusses the impact of data caching on performance in details and looks at topics like concurrency, data caching levels, how to assess caching performance etc
- the chapter ends with an absorbing discussion on performance considerations from a cloud deployment perspective
chapter 11 – performance tuning tips
this lesson provides general performance tuning tips, tricks and recipes for a variety of scenarios and use cases related to java ee as well as se
- deals with java ee component specific performance secrets – ejb, jsf, jpa, web services etc
- explores general performance related topics from the java se space – i/o, collections framework, synchronization etc and also peeks into the javap tool available in the jdk
- the chapter ends with a discussion aobut database related performance tips ranging from choice of orm library to executing bulk uploads in an optimized manner.
chapter 12 – tuning a sample application
this lesson is all about getting our hands dirty and applying the concepts learnt in the book in order to tune a real-world application
- introduces the sample application, and sets up an assessment plan
- guides us through the profiling process using previously described techniques such as cpu time, memory profile etc
- deep dive into analysis of performance issues detected by the profiling process and resolution of each of those issues
- coverage of the testing process to assert performance improvements post issue resolutions
performance tuning is not an easy topic to discuss or write a book about. although it is based upon reasoning and science, more often than not, it is triggered due to unprecedented scenarios.
- the author covers a vast landscape in general – from depths of the java platform basics, jvm to app server tuning, databases and straight on to the cloud !
- in general, the book is applicable to wide variety of audience, but the day-to-day/ traditional java developers stand to reap maximum benefit out of this book
- the sample application tuning exercise is a great addition to the book. again, performance tuning is not an easy thing to discuss and convey and setting up a application for hands on practice needs is indeed priceless
- leverages sample code, examples and pictorial representations in an effective manner.
note : while most of the aspects of the book are great, but there are certain areas in the book where the grammar and overall english could have been better. personally, it did not prove to be a hindrance for me, but can be improved.
where can you grab the book?
a book this versatile and multi-faceted should not be missed – especially when it deals with performance tuning !
visit the packtpub web site to get your copy!!
happy reading :-)
Published at DZone with permission of Abhishek Gupta, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.