Thursday, January 27, 2011

JBoss AS 5 Performance Tuning - Book Review


The last couple of days I had the opportunity to review a copy of "JBoss AS5 Performance Tuning", by Francesco Marchioni, which is almost a sequel to a previous book of his on JBoss AS5 Development.

You can take a peek at the table of contents here.

I think the book does a great job at explaining the concepts and methodology behind performance tuning and introducing the tools of the trade required to get you going. It identifies the various places and hotspots where performance tuning makes sense, starting from the Operating System, up to the Java Virtual Machine, the application server and finally your own application.

Expect to find tuning tips for a wide spectrum of areas including:

- JVM tuning
- JBoss AS slimming
- Configuring logging, levels, format, sync vs. async
- Pool sizing (JNDI, EJB, ...), Caching
- JBoss Messaging & HornetQ tuning
- DB design tips, JDBC tuning, JPA Query/Entity Caching
- Clustering, JGroups, JBoss Cache
- Tomcat/JBossWeb configuration and fronting options (mod_jk, mod_proxy, mod_cluster)
- WebApp tuning, bare servlet vs. JSF vs. Richfaces
- ...and more

The author's suggestions are usually backed by evidence, i.e. trying the different configuration options and measuring the results. This is also a major takeaway from the book in that you may follow certain best practices but unless you make tuning a part of your development cycle, by establishing a baseline and continuously testing and measuring and improving, you are really left in the dark.

Some tuning tips might be surprising, like for example, just changing the logging format can speed up an application by 10%, the async logging appender could give you worse performance, or that the native jbossweb connectors do not perform well on windows.

What I really liked about this book:

- It's very practical and down to earth without much fluff.
- It includes useful sample tuning use cases, e.g. finding a memory leak.
- It covers the majority of areas where tuning can be applied.
- Summaries are very good and can be used as checklists.

Timing wise, it's a bit unfortunate the book was released at the same time JBoss AS 6.0 was released, but in practice, the book applies just fine to JBoss AS 6.x as it applies to JBoss AS 5.x and JBoss EAP 5.x. The only exception is Infinispan that replaced JBoss Cache, although the basic caching principles are the same. Maybe an addendum for Infinispan could sort this out.

To conclude, I'd recommend the book to whoever is interested in tuning his applications on top of JBoss AS and using the author's words:
"good performance is not accidental; it takes planing, expertise, and plenty of testing"
Cheers
/Dimitris

2 comments:

Francesco Marchioni said...

Hi Dimitris,
thank you for taking the time to evaluate my book. Appreciation of one's work done by top-level people like you is the best reward!
All the best,
Francesco Marchioni

Dimitris Andreadis said...

@Francesco

thanks for putting time into writing this book. I'm certain it will be appreciated by the community.