views:

118

answers:

2

We're developing a few new services that will run on JBoss and will be accessible by REST API-s. These will be Java apps bundled into EAR files. Is it a good practice to deploy these services to the same JBoss server?

This would simplify dev, deployment and testing.

Not sure if there are any big drawbacks. Would there be limited memory which the apps would have to share? In which case, would deploying to separate servers be better? Can one app cause the others to crash (ie: by hogging all the memory)?

+2  A: 

You can deploy multiple services on one application server instance, and as far as I know that's the most common scenario : appservers tend to need quite some resources, deploying a lot of them each with one application loaded will seriously increase the resource usage of the solution.

These applications will be sharing the available memory and one jvm, and bugs in one application can bring the server down. Therefore you will want to supervise the heap of application server, along with some other "vitals". You can do it manually with jconsole (part of the JDK) or automatically with a tool like the excellent hyperic. Hyperic itself btw is based on a JBoss server.

fvu
A: 

Any time your applications reside on the same server, you run into issues of shared resources and reduce the granularity with which you can scale your services.

Here's a simplified example: Say your server has 4GB of RAM available to applications. Service 1 requires 2GB of RAM, while Service 2 and 3 each require 1GB. If you get lots of traffic on Service 3, the only straightforward way to deploy more capacity is to launch a new server, with most of the RAM dedicated to Service 1 and Service 2 even though they don't get much traffic.

The constraint might actually be RAM, CPU, or IO. The fact is, if you deploy multiple services together, you limit your flexibility when it comes to scaling out.

Whether this will be an actual problem in your case is something you need to determine.

Eric J.