且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么我们在同一台服务器上使用多个应用服务器实例?

更新时间:2023-11-22 18:58:46

嗯......经过很长一段时间我再次看到这个问题:)

那么一台机器上的多个JVM实例解决了很多问题。首先我们要面对这个问题:虽然JDK 1.7已经出现,但很多遗留应用程序是使用JDK 1.3或1.4或1.5开发的。现在您的问题是:

从历史上看,这里有一大块JDK被分配给它们。是系统架构师通过在一个盒子上部署多个JVM而解决的三个主要问题:


  1. 垃圾收集效率低下:$ c>随着堆大小的增长,垃圾收集周期 - 特别是对于主要收集 - 往往会导致处理过程中的重大延迟,这要归功于单线程GC。多个JVM通过允许更小的堆大小以及GC周期期间的某种并发性度量(例如,当有四个节点,当进入GC时,还有三个节点正在处理),来对抗这种情况。

  2. 资源利用率:较旧的JVM无法高效扩展四个CPU左右。答案?为盒子中的每2个CPU运行一个单独的JVM(当然,里程可能会因应用程序而异)。

  3. 。同样,多个JVM允许您最大化资源利用率。

  4. 可用性:人们有时在一个盒子上运行多个JVM的最后一个原因是可用性。虽然这种做法确实无法解决硬件故障,但它确实解决了应用服务器单一实例中的故障。


摘自( http://www.theserverside.com/discussions/ thread.tss?thread_id = 20044



我大部分都看过weblogic。以下是进一步阅读的链接:



http://download.oracle.com/docs/cd/E13222_01/wls/docs92/perform/WLSTuning.html#wp1104298



希望这可以帮到你。


I guess there is a good reason, but I don't understand why sometimes we put for example 5 instances having the same webapplications on the same physical server.

Has it something to do with an optimisation for a multi processor architecture? The max allowed ram limit for JVM or something else?

Hmmm... After a long time I am seeing this question again :)

Well a multiple JVM instances on a single machine solves a lot of issues. First of let us face this: Although JDK 1.7 is coming into picture, a lot of legacy application were developed using JDK 1.3 or 1.4 or 1.5. And still a major chunk of JDK is divided among them.

Now to your question:

Historically, there are three primary issues that system architects have addressed by deploying multiple JVMs on a single box:

  1. Garbage collection inefficiencies: As heap sizes grow, garbage collection cycles--especially for major collections--tended to introduce significant delays into processing, thanks to the single-threaded GC. Multiple JVMs combat this by allowing smaller heap sizes in general and enabling some measure of concurrency during GC cycles (e.g., with four nodes, when one goes into GC, you still have three others actively processing).

  2. Resource utilization: Older JVMs were unable to scale efficiently past four CPUs or so. The answer? Run a separate JVM for every 2 CPUs in the box (mileage may vary depending on the application, of course).

  3. 64-bit issues: Older JVMs were unable to allocate heap sizes beyond the 32-bit maximum. Again, multiple JVMs allow you to maximize your resource utilization.

  4. Availability: One final reason that people sometimes run multiple JVMs on a single box is for availability. While it's true that this practice doesn't address hardware failures, it does address a failure in a single instance of an application server.

Taken from ( http://www.theserverside.com/discussions/thread.tss?thread_id=20044 )

I have mostly seen weblogic. Here is a link for further reading:

http://download.oracle.com/docs/cd/E13222_01/wls/docs92/perform/WLSTuning.html#wp1104298

Hope this will help you.