4

我有一个在 Tomcat 上运行的 Java Web / SIP 应用程序。该应用程序的大小可在 Windows 2003 上运行,在虚拟化环境中使用 4 GB RAM 和 4 个 vCPU 进行 1000 个并发会话。

现在应用程序迁移到 Windows 2008,Tomcat 仍然是 32 位,应用程序是用 32 位 Java 编译的,32 位应用程序也是如此。有了这个设置,我的 2008 年性能。测试的工作方式与在 Windows 2003 上的工作方式不同。CPU 利用率达到峰值,许多呼叫被丢弃。

我在这里有以下问题。

  1. 在 64 位环境中运行 32 位应用程序是否需要额外的 CPU / 内存,这会在此处产生问题。

  2. Win 2003 和 Win 2008 之间是否存在性能差异。

  3. 与 2003 相比,Windows 2008 是否因为 64 位环境需要更多 CPU。

4

3 回答 3

1

We had a similar situation sometime back and we tried moving a 32 bit app (Tomcat based J2EE app) to 64 bit machine. We observe consequence as you are facing.

BTW you don't mentioned why you moved to 64 bit OS :).

Let's take your questions one by one

Does Running 32 bit application in an 64 environment take extra CPU / Memory which is creating issue here.

In general yes. But it depends on your processor architecture as well. To understand this, look at the way Windows runs 32 bit application on a 64 bit machine. There is a subsystem within 64 bit OS called WoW64 (Windows 32-bit on Windows 64-bit)

Primarily there are two ways WoW64does it

  1. Emulating a 32 bit instruction. This computationally very expensive and probably is the cause of CPU usage spike. This is generally the case when used with Intel Itanium (IA-64) based processors.

  2. Switching the processor to 32 bit mode from 64 bit mode. Here, whenever a 32 bit application thread needs to be executed, the processor is switched to 32 mode (compatibility mode) and then switch back to 64 bit mode. This is relatively faster than earlier emulation mechanism.

Is there a performance difference between Win 2003 and Win 2008.

This is very subjective. It depends on the kind of hardware you use. Even if you have 64 bit OS and hardware, a lot depends on the kind of hardware, motherboard CPU etc. 64 Bit OS is designed to leverage superior hardware which a 32 bit OS and machine cannot by virtue of limitations like addressing space etc.

Does Windows 2008 because of 64 bit environment requires more CPU compare to 2003.

Yes. as @EJP mentioned above, it has more things to offer. A more capable OS would need superior hardware. It may be the case the your particular application may or may not need any Win 2008 specific features. That's the reason you need to take a call on why you need to move to 64 bit from 32 bit. Here is similar post on the same forum.

BTW I am not sure if you have an option but you can run the same code without rebuilding (if you are not using any platform specific libraries) on 64 bit Tomcat.

于 2012-04-04T15:51:20.183 回答
0
  1. 不是特别。
  2. 是的。有时它非常重要。我看到过去以曲速运行的程序存在各种延迟。
  3. 是的,但不是因为 64 位,只是因为它有更多。
于 2012-03-20T07:41:46.117 回答
0

我认为您之前安装的 SIP 应用程序和 Java 已经过优化,而新的还没有。Windows 2003 的最新 SP 和 2008 的最新 SP(基于 Vista)在网络和 java 方面没有性能差异,但是 Win 2008 R2 使用 java 更快,因为更智能的 CPU 亲和力,甚至可以在 VM 中工作。基本上,我会查看您的 java,如果可以,请确保您正在运行 64 位 java,它使用“-server”开关运行,并且您的垃圾收集器具有选项,例如 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX :NewSize=128m,还要检查 java opts set JAVA_OPTS=-Xmx3000M -server。

还要确保您运行最新的 java 版本,您对系统进行了 Windows 更新,包括驱动程序以及您更新了可视化软件、BIOS、BMC 以及存储固件。

最后,只需检查任务管理器是否真的是 Java 峰值,您的 LAN 连接 (ping) 没有丢弃数据包,并且您在机器的 bios 中关闭了电源管理。

我建议您升级到 Win 2008 R2 - 基于 Win 7。

如果您使用的是公共云,这可能不是设置的问题,而只是云服务器与另一个虚拟服务器共享 CPU,因此您的应用程序卡住了。

于 2012-04-08T20:08:55.693 回答