且构网

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

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

更新时间:2023-11-22 18:41:10

嗯...过了好久我又看到这个问题 :)

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

一台机器上的多个 JVM 实例解决了很多问题.首先让我们面对这一点:尽管 JDK 1.7 即将出现,但许多遗留应用程序是使用 JDK 1.3 或 1.4 或 1.5 开发的.仍然有很大一部分 JDK 被分配给它们.

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.

现在回答您的问题:

过去,系统架构师通过在单个机器上部署多个 JVM 解决了三个主要问题:

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

  1. 垃圾收集效率低下:随着堆大小的增加,垃圾收集周期——尤其是主要收集——往往会在处理中引入显着延迟,这要归功于单线程 GC.多个 JVM 通常通过允许较小的堆大小并在 GC 周期期间启用一些并发度量来解决这个问题(例如,有四个节点,当一个节点进入 GC 时,您仍然有另外三个正在处理).

  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).

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

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).

64 位问题: 较旧的 JVM 无法分配超过 32 位最大值的堆大小.同样,多个 JVM 允许您最大限度地利用资源.

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.

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

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.

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

我大部分时间都看到了 weblogic.这是进一步阅读的链接:

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

希望对你有帮助.