Speeding up JBoss 6 Deployments in Development Environment

Home » Speeding up JBoss 6 Deployments in Development Environment » Java » Speeding up JBoss 6 Deployments in Development Environment

For several I was convinced that the application deployment process implemented by WebSphere was the worst-performing in the world. Well, that happened until I met JBoss AS 6.  In order to properly deploy an application JBoss simply explodes all of its JARs into a temporary folder, “$JBOSS_HOME/server/<server>/tmp”.  This is a known JBoss bug, more details can be found here:   https://issues.jboss.org/browse/JBAS-8786.

Depending on the footprint of your application tens of JAR files will be unpacked into the aforementioned folder every time you deploy something to the server or start it up – and obviously this takes a lot of physical disk I/O and consequently lots of time.

A RAM disk can help reduce disk I/O, in the scenario I am currently working on the deployment time was reduced from 3.5 to 1.5 minutes, something meaningful for development environment.

Below are steps for using a RAM disk with JBoss 6 in order to mitigate the aforementioned issue on a Microsoft Windows system.

  1. Download and install Dataram RAM Disk from http://memory.dataram.com/products-and-services/software/ramdisk

    Dataram RAMDisk.

  2. Configure and start up the Dataram RAMDisk. For my scenario, 600MB did the trick.
  3. Verify if the RAM disk was successfully created. In my system, it was assigned to the F: drive.

    RAMDisk Drive.

  4. Create a “tmp” folder at the root of your RAM disk.
  5. Configure JBoss AS. Add the line ”-Djboss.server.temp.dir=”F:tmp” ^” to you server’s “$JBOSS_HOME/bin/run.bat” file, at the location shown in the picture below. This line must be adjusted to point to the drive letter of your RAM disk.

    Editing run.bat.

  6. Start up your application server. You should find something similar to the picture below in your JBoss console:

    Server Temp folder configuration pointing to the RAM disk.

 

Server initialization without RAM disk:

Server initialization with RAM disk:

Make sure that you properly shutdown your AS, otherwise temporary files won’t be deleted and you will end up with you RAM disk full. This approach will might make deployments even slower if you don’t have free memory enough for the RAM disk.

Leave a Comment