Search code examples
javadeploymentglassfishearapplication-server

Multiple components deployed to same application server


Although I'm primarily interested in Java/GlassFish with this question, I would certainly think it applies to any platform/app server.

Is it possible to deploy multiple instances of the same JAR, WAR or EAR to the same GlassFish server, for the purposes of scaling? Meaning, if I have MyApp.ear, and it looks like I need to scale it up to handle a spike in load, can I re-deploy 2+ instances of MyApp.ear inside the same GlassFish server?

Is it practical to do this?


Solution

  • It is definately possible on JBoss atleast so I suppose it also on GlassFish. I wonder however, how would this help with scaling? If you lack performance on a single server, you might want to just look into configuring GlassFish. You can probably tweak the JVM settings to handle the spike loads.

    I think to scale a java application you should run it on different servers. You could do this for your entire application or a part of it. (for example if you have a n tier architecture you could have your tiers running on different servers, this will require some or alot of refactoring)