Sunday, June 12, 2011

My Test Drive on JBoss AS 6.0.0

Took a test drive of JBoss 6.0.0 this weekend, thought would be nice to summarize my observation (with the background of using JBoss 4.3.0 version for my current projects).

JBoss 6.x.x is a re-architecture of JBoss 4.x with new the kernal (JBoss Microcontainer). Good news for application developers not much of change to the folder structure with exception of few new configuration files & some old ones were moved around.

High Lights
  1. Default support to Java EE 6.0 Specification support.
  2. JSF 2.0 support with integration with Bean Validation (JSR-303)
  3. CDI (Contexts and Dependency Injection) JSR - 299 , Weld is JBoss project to support CDI.
  4. Hornet MQ is the default & recommended messaging infrastructure.
  5. New Apache CXF-based JBossWS stack.
  6. JBoss Embedded AS
  7. New Admin-Console to ease the server administration.
Admin-Console
  1. New Admin-Console is a refresher, user friendly with tree based navigatio.
  2. Lot of resembles to Weblogic Admin console :), never mind it does the purpose.
  3. All configuration parameters are persisted for good, unlike the JBoss 4.* version.
  4. "Service Binding Manager" Component externalizes all port configuration for a given/running profile. This saves lot of time fiddling with the raw .xml files :) as in 4.3.0.
  5. Applications (.war, .ear) can be added/updated dynamically using the console.
  6. Queues & Topic can be added dynamically using the console.
  7. Database connection pools can be added dynamically using the console.
  8. You have provision to restart/start/shutdown the server using the admin console.
  9. Very detailed Garbage Collector / Memory pool info on the console.
  10. The Metric tab for every component provides you useful statistics/metrics an the component. Ex: Selecting a queue provides (Message count, consumer count etc.)

JMX-CONSOLE
  1. JMX-CONSOLE is still available, but with a new look & feel.

Others
  1. Jboss VFS (Virtual File System), help yourself reading this article to understand.
  2. Jboss Web is the default webserver offering from JBoss 5.x.x, build on top of Tomcat.
  3. Felt the Server startup & Shutdown is slower than 4.3.0 GA :( hoping minor tweaks should take care of it.
  4. Couldn't find any documentation on migration from 4.3.0 to 6.0.0, will keep looking...
Reference
Jason Greene - What's new in JBoss AS 6.0.0
Admin Console user guide
www.jboss.org
www.java.dzone.com

Friday, June 10, 2011

Power of AccessLog & Tomcat Valve configuration

In recent past we faced quite a performance issues resulting in different modes of collecting performance statistics from web server. One of the handy tool was web server access logs, all I had to do is configure my webserver to write access logs. It dumps all the requested information (URL, Timestamp & Even roundtrip/response time of a request), How cool... with zero additional code you get response time of each request.

Link below details of access log configuration on tomcat, this could vary depending on the type of webserver used. But every webserver would have a access log by default.
http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html#Access_Log_Valve

All different types of valves supported by Tomcat, most useful of it all is "Request Dumper" valve (dumps all request detail) & "Access Log" Valve.
http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html#Request_Dumper_Valve

Example, below configuration (%D %T) will log response time for a request & timestamp of the request.


Valve className="org.apache.catalina.valves.AccessLogValve" prefix="localhost_access_log." suffix=".txt" pattern="%D %T"

Lot of tools can help you analyze the access logs & provide more insight of the usage response time etc.
http://www.nltechno.com/awstats/awstats.pl?config=destailleur.fr

Conclusion: We all know it's mandatory for a web server to have an access log,
but the good part is this can greatly ease performance study & tune
your web application.