Tuesday May 06, 2014

New book: Java Performance - The Definitive Guide

"Don't lower your expectations to meet your performance.
Raise your level of performance to meet your expectations."

(Ralph Marston)

As its title imply "Java Performance: The Definitive Guide - Getting the Most Out of Your Code" covers Java Performance at large.

Let's start with the beginning. In order to isolate any potential performance issue, you first need to be able to accurately measure performance. The first part of the book discusses general methodologies for testing Java applications. It also discusses the usual pitfalls of Java benchmarking.
Performance analysis is about about observing and understanding what an application is doing so the book continues with an ideal Java Performance Toolbox. It covers some of the tools available to monitor Java applications. It should be mentioned that Java Mission Control that has been recently added to Java SE 7 (starting with update 40) and Java SE 8 is also discussed.
The book then dive into Java performance by discussing in great details two key fundaments that are the JIT (Just-In-Time) compiler and the Garbage Collection.
The remaining chapters focus on best practice uses of various parts of the Java platform. It's the platform at large as it goes from memory use with the Java heap, native memory use, thread performance to Java EE, JPA and JDBC!

Scott Oaks, the author, has spend more than 15 yeas in the Java Performance Group at Sun and now at Oracle. I know Scott since more than 12 years, he is clearly someone that understand all the aspects related to Java Performance, from measuring to tuning. And not only that, Scott has also the capacity to distillate sometime complex technical aspects into easy to understand points. From a Java EE point of view, the book doesn't obviously covers the complete platform (see the ToC here) but nevertheless the book is a really a must-read for anyone writing Java applications based either on Java SE or Java EE. And the fact that the book also discusses Java EE and some of its APIs is certainly a nice additional bonus for any Java EE developer!

Wednesday Dec 04, 2013

Java Mission Control with Marcus and Markus

"You can observe a lot by just watching." (Yogi Berra

Java Mission Control (JMC) is a JVM production time profiling and diagnostics suite of tools. The suite includes tools to observe, manage, profile, and eliminate memory leaks in Java applications and due to its very low overhead, JMC is particularly fitted to detect performance issues in applications running in production. 

JMC is based on runtime performance analyzing capabilities that were originally only available in JRockit. It is the fruit of the work Oracle has done over the last years to convergence its 2 JVMs (HotSpot and JRockit) into a single one. Starting with the 7u40 release, JMC is available in the regular HotSpot distribution. It is a commercial feature that can be used freely in development as per the standard Oracle Binary Code License (BCL).

Marcus Hirt (@hirt) of the Java Mission Control team wrote a nice introduction on Java Mission Control. Markus Eisele (@myfear) wrote another post showing how to quickly configure JMC and JFR with GlassFish 4.

Tuesday Apr 03, 2012

Tuning GlassFish for Production

The GlassFish distribution is optimized for developers and need simple deployment and server configuration changes to provide the performance typically required for production usage. The formal Performance Tuning Guide provides an explanation of capacity planning and tuning tips for application, GlassFish, JVM, and the operating system.


The GlassFish Server Control (only with the commercial edition) also comes with Performance Tuner that optimizes the runtime for optimal throughput and scalability.

And then there are multiple blogs that provide more insights as well:

Optimizing GlassFish for Production (Diego Silva, Mar 2012)
GlassFish Production Tuning (Vegard Skjefstad, Nov 2011)
GlassFish in Production (Sunny Saxena, Jul 2011)
Putting GlassFish v3 in Production: Essential Surviving Guide (JeanFrancois, Nov 2009)
A GlassFish Tuning Primer (Scott Oaks, Dec 2007)

What is your favorite source for GlassFish Performance Tuning ?

Tuesday Jan 31, 2012

Another look at GlassFish clustering and performance

With this new "Glassfish – Vertical clustering with multiple domains" blog by Alexandru, there seems to be no shortage of GlassFish configuration posts.

Surely, that must say something about the popularity of GlassFish for highly-available apps.


While it uses mod_jk like most others, this one is multi-domain, uses JMS topics and spends some time looking at different JVM settings and their impact on response time and GC activity.

Wednesday Jan 04, 2012

Make GlassFish Scream

All GlassFish versions come with a Performance Guide but sometimes it's good to read an all-in-one article about how to get the most performance out of your application server.

Whether you're looking at performance tuning for GlassFish for the first time or whether you've done this before, René's recent article over on Middleware Magic should be time well spent.


René has "committed" a number of other Java EE and GlassFish-related articles which are all well worth reading, including this earlier "Fun with GlassFish" detailed piece on setting up an entire GlassFish cluster, step by step.

Tuesday Dec 20, 2011

Grizzly 2.2 is here, WebSocket inside! (& more)

As you may have heard the WebSocket protocol, often described as one of the key elements of HTML 5, has finally been blessed (check out RFC 6455).

Well, it only took Grizzly 10 days or so to implement this final specification and ship Grizzly 2.2 (granted it's been keeping up with all the interim releases).


In other important addition to this release, the Grizzly Async HTTP Client will soon hit 1.7.0 and also offer WebSocket support! Non-Blocking Sendfile Support and write I/O Thottling as a protection against async write queue overloading are also new in this release.

This version of Grizzly will be integrated into GlassFish 4.0 (and may already be in the trunk by the time you read this), while 3.1.2 will ship with 1.9.42 (or later), both do offer support for RFC 6455.

How many more server-side implementations out there supporting the WebSocket protocol?

Friday Nov 04, 2011

Tab Sweep - Jersey, Hudson, GlassFish Hosting, GC's compared, Spring to JavaEE, Modularity, ...

Recent Tips and News on Java, Java EE 6, GlassFish & more :

Radio Receiver

Jersey 1.10 released (Jakub)
The Hudson Book (eclipse.org)
Comparing Java 7 Garbage Collectors Under Extreme Load (Nerds Central)
GlassFish Hosting (Enciva)
Spring to Java EE Migration, Part 1 (OTN)
ASM 4.0 released (OW2)
Adopt A JSR! (The Java Source)
Early signs of EJB 3.2 (GlassFish source)
Practical challenges of profiler integration with Java/J2EE applications (TheServerSide)
LOGBack 1.0 (qos.ch)
55 New Things in Java 7 (DonaldOJDK Blog)
Java 8 and OSGi modularization (Neil and Tim)

Thursday Oct 13, 2011

Java Performance (The Java Series)

Performance talks and books are always very popular and this new "Java Performance" book should be not exception.

Authors Charlie Hunt and Binu John wrote this book standing on the shoulders of the makers of this earlier book and managed to produce a definitive guide to performance.

This 700-page book covers performance goals, JVM monitoring & tuning, hotspot detailed architecture and behavior, but also a large portion on Java EE and application server performance and tuning. In fact four chapters are dedicated to multitiered applications, web applications, web services, as well as JPA and EJB performance.


If you are using GlassFish and trying to make the most out of your application, you'll find the various book examples using GlassFish to come in very handy.

Monday Jul 18, 2011

More Production GlassFish tuning

Probably as a sign that many GlassFish-powered applications are moving into production, a number of recent community posts discuss GlassFish 3.x in production and related performance tips. All are great additions to the standard Performance Tuning Guide.


This first article discusses using the CLI (asadmin) for those that were used to the IDE or the Web Console as well as some JVM and GlassFish tuning. This other piece by Vegard goes a little bit further on the tuning side of things (acceptor threads, caching, ...) and this earlier piece by Jean-François Arcand is pretty much still valid.

On a slightly related note, Henri Gomez has a quick comparison of various container startup times. You decide if this is an apple-to-apple comparison ;)

Sunday Mar 06, 2011

GlassFish 3.1 SOTD #6 - Monitoring Scripting Client

In this sixth post of the SOTD (Screencast Of The Day) series following the release of GlassFish 3.1, here is Tom's Monitoring Scripting Client.

This is a feature that is part of Oracle GlassFish Server Control which comes bundled with Oracle GlassFish Server and available for free trial.

This 8-minute demo shows how this scripted monitoring command (asadmin run-script) can operate on a 2-instance cluster (setup included in the demo) using one of the 100+ fine grained probes defined in JavaScript. This is a supported version of the technology previously made available in beta form and which now obviously has been extended to clustered environments.

This screencast is hosted on the GlassFish YouTube Channel.