3 Replies Latest reply on Sep 27, 2006 12:19 PM by Will Tatam

    1 jboss and 25 deployments of 1 application

    Randahl Fink Isaksen Novice

      For an application provider system I need to deploy a large number of instances of the exact same application. The wiki has suggestions for installing multiple jboss servers on a single box, but I would expect that what I need is to install multiple instances of my application into a single jboss server instance on a single box. This raises a couple of questions:

      1. Can JNDI clashes occur?
      From what I have read JBoss uses a single JNDI tree per server. My problem is I have a large number of Swing clients that connect to each their own application instance. They communicate with the server side through session beans which they look up using JNDI, but I expect this will not work once I have multiple applications, since each application will attempt to register its own instances of the session beans on the same JNDI address.
      So what I would like to know is this: Am I forced to deploy each application's session beans with different JNDI names and write special client code which looks for the application specific JNDI names? Could anyone comment on whether that way is a good way? Are there any alternatives?

      2. Can I expect a performance gain?
      The reason I want to deploy all the application instances into the same JBoss instance is I expect it to perform better. If I gave each application its own JBoss instance I would expect this would consume much more RAM and take a lot more CPU time as well. On the other hand I am using class loader isolation so each application has its own class loader - this means that each application will have its own set of classes, so no RAM saving there. Has anyone got any experience with single JBoss vs. multiple JBoss performance and RAM consumption?

      3. Is multiple JBoss server instances a viable alternative?
      If we are to run 10, 25 or 50 applications per box is it *at all* a reasonable alternative to run a JBoss server instance per application instance? Has anyone ever installed 25 JBoss instances on the same box?

      If anyone has any thoughts, views, experiences or hints I would be very happy to hear from you.



        • 1. Re: 1 jboss and 25 deployments of 1 application
          Frank Langelage Master

          We decided to use one jboss instance for many application instances.
          To separate the app instances we prepend the jndi names with a unique name per app.
          Let's make it simple: two app instances (prod & test), one session Bean (Customer) local and remote accessible.
          This gives
          - prod/Customer
          - prod/CustomerLocal
          - test/Customer
          - test/CustomerLocal
          We use XDoclet and ant to generate and build. Our own code has "@APP_INST@/Customer" as jndi-name. In an ServiceLocator used for all lookups whe replace "@APP_INST@" with the current app instance's name (prod or test).
          The same is used for the client.

          Already without any app, only running the standard config of jboss you have a reasonable memory consumption. Having 50 of these jboss servers on one computer will require many GB's of RAM. One jboss instance with 50 app instances will consume much less.
          Our app code in a classloader per app is only a part of the executed code. All apps will share the jboss code which will get compiled by the hotspot compiler.

          • 2. Re: 1 jboss and 25 deployments of 1 application
            Randahl Fink Isaksen Novice

            Interesting reading - thanks for your post.


            • 3. Re: 1 jboss and 25 deployments of 1 application
              Will Tatam Newbie

              i'de like to do something similar, but in my case i want to have multiple instances of the same application as we a providing our product as a hosted solution and having multiple jboss instances all on their own ip address would seam rather wasteful

              Do you know of any way of doing the prefix without needed to recompile ?