Adam Bien's Weblog

Tuesday Jun 24, 2008

How Fast Is The Build And Deployment Of about 660 JPA Entities And 50 Session Beans On Glassfish v2 And Netbeans 6.1?

I'm often asked about the deployment performance of Glassfish v2 in Real World. If you have just few EJB 3 and JPA-Entities the whole build and deployment takes only few (1-3 ) seconds. In Real World you will have rarely only few components to deploy, so I just measured the performance in the one of my current projects. The initial (standard Netbeans) ant build and deployment of JSF application with 660 JPA Entities and about 80 EJB 3 in an EAR, with creation of  tables etc. takes:

Enable of application in all targets  completed successfully
All operations completed successfully
post-run-deploy:
run-deploy:
BUILD SUCCESSFUL (total time: 2 minutes 32 seconds)

Subsequent redeployments are much faster - and takes about:

Enable of application in all targets  completed successfully
All operations completed successfully
post-run-deploy:
run-deploy:
BUILD SUCCESSFUL (total time: 41 seconds)

 In both cases the full cycle (clean, build deploy and undeploy) ot the whole EAR was tested. It seems like preparing the named queries and deploying the JPA entities consumes most of the time.

The first deployment in incremental / or activated directory deployment (goto -> services -> Glassfish -> options in Netbeans 6.1). Is very slow:

Enable of application in all targets  completed successfully
All operations completed successfully
post-run-deploy:
run-deploy:
BUILD SUCCESSFUL (total time: 7 minutes 6 seconds)

But subsequent deployment become really fast. I changed some JSFs and EJBs and it took:

Browsing: http://localhost:8080/myapp/
run-display-browser:
run-ac:
run:
BUILD SUCCESSFUL (total time: 6 seconds)

opening the browser included :-).

If you like to use the incremental deployment, use the "Run" option in Netbeans, instead of  "Undeploy and Deploy".

It was tested on Glassfish v2 (developer profile) on Java 6 update 10, Oracle XE, Netbeans 6.1 ...and Windows Vista 32 bit (without activated virus scanner :-)) on a IBM notebook. However from time to time it seems like Windows locks the files - so I have to restart Glassfish then. It seems to be a Windows problem - it occurs only in the "directory deployment" mode.

See you at Jazoon'08 :-)!.


NEW: Java EE 7 Testing and Quality Workshop

A book about rethinking Java EE Patterns

Comments:

Adam,

There is a significant fix to the initial deploy time issue that you are seeing. Read through http://www.netbeans.org/issues/show_bug.cgi?id=136307 for details.

The fix for this issue is included in Patch 2 for NB 6.1... The details about that are available here: http://wiki.netbeans.org/NetBeans61Patch2Plan.

I hope that you will be able to retry the initial deploy test and be pleasantly surprised.

Posted by vince kraemer on June 25, 2008 at 05:34 AM CEST #

I am currently working on my diploma thesis and searching for an open source project with many JPA Entities and EJB3 Beans (and JSF GUI). It should be an data centered application like CRM, ERP etc.

Can you recommend one?

Posted by Marcel Gleis on June 25, 2008 at 10:04 AM CEST #

Hi Marcel,

this particular project is everything, but not opensource :-). Just check out the "CRM", "ERP" solutions.

regards,

adam

Posted by Adam Bien on June 25, 2008 at 11:42 AM CEST #

Vince,

interesting. 7 minutes for the very first time is not so bad :-). The subsequent deployments are really fast - so it is not a huge problem for me.
I'm already looking forward for the patch. Any dates?

thank your very much for the comment!,

adam

Posted by Adam Bien on June 25, 2008 at 11:44 AM CEST #

I have to disagree with you. Seven minutes is terrible. I reckon that the first directory deployment should be in the 2-4 minute range. Anything longer than 2x the archive deployment speed is a time that I would consider a bug.

I wish that you had posted this data back in January.

I think the patch is still on target for July 2, 2008.

Posted by vince kraemer on June 25, 2008 at 07:20 PM CEST #

Vince,

in January the project was much smaller - so at that time it took probably 2-4 minutes :-).

thanks for your feedback,

adam

Posted by Adam Bien on June 25, 2008 at 10:13 PM CEST #

I wonder how the incremental deployment works in Netbeans. Glassfish's asadmin deploy/deploydir commands do not support this. Is it based on JMX?

It would be nice to have incremental deployment in Eclipse and ant. Haven't found a way yet, so maybe you guys have a hint for me.

Posted by Markus Junginger on July 03, 2008 at 09:45 PM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
realworldpatterns.com
...the last 150 posts
...the last 10 comments
Links
License