从 Windows 到 Solaris JBoss 的 Java 性能问题
我有一个简短的问题,也许有人能够回答。我们最近构建了一个 Java 库,在 JBoss 应用程序服务器上运行的 Web 服务中引用该库。 Web服务在标准Windows XP机器上的性能令人满意,整个过程大约需要1.5秒。然而,当我们在 Solaris JBoss 计算机上部署 Web 服务时,我们注意到性能显着下降,尽管托管 Solaris 的虚拟服务器功能更加强大。当人们期望 Windows 机器的整体速度要好得多时,整体处理时间增加到 3.6 秒。 Windows 机器是一个简单的 Pentium 桌面,其中 Solaris 在 Sun Sparc 上托管的虚拟服务器中运行。首先想到的是垃圾收集,因为这个库使用了大量的数组、数组列表并频繁分配新对象。有没有人对可能发生的事情有类似的经历或想法?
问候 季米特里斯
I have a quick question that someone might be able to answer. We have recently built a java library that is referenced within a web service that runs on a JBoss application server. The performance of the web service on a standard Windows XP machine is satisfactory and takes about 1.5 seconds for the whole process. However when we deploy the web service on a Solaris JBoss machine we notice a significant decrease in performance although the virtual server where Solaris is hosted is much more powerful. The overall processing time increases to 3.6 seconds when one would expect a much better overall speed from the windows machine. The windows machine is a simple Pentium desktop where Solaris runs in a virtual server hosted on a Sun Sparc. The first thing that came to mind is Garbage Collection as this library uses a lot of arrays, arraylists and frequently allocates new objects. Has anyone had a similar experience or ideas of what might be happening?
Regards
Dimitris
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,但我建议你附加 jvisualvm 来看看时间都花在哪里了。
还可以使用标准 Solaris 工具(如 iostat 和 vmstat)来确定是否有硬件资源耗尽。
No, but I would suggest you attach with jvisualvm to see where the time is spent.
Also use standard Solaris tools like iostat and vmstat to identify if any hardware resource is exhausted.
您需要使用某种形式的分析来检验您的假设。在应用程序服务器之外分析代码通常要容易得多,除非您有合适的工具可以就地执行此操作(例如 OptimizeIt 之类的工具)。
您可以在 JBoss 环境之外测试您的库的性能吗?
如果可以的话,那么这就是开始的方式。一旦您拥有了测试工具,您就可以开始分析各个组件和子组件,以了解时间都花在哪里了。
在测试环境中,执行关闭垃圾收集或增加起始堆大小和最大堆大小等实验要容易得多。
实验中的观察结果将为你提供新的想法,告诉你应该去哪里寻找以及进行进一步的实验。
You will need to test your hypothesis using some form of profiling. It is usually much easier to profile code outside of the application server, unless you have suitable tools available to do this in place (e.g. something like OptimizeIt).
Can you test the performance of your library outside of the JBoss environment?
If you can, then this is the way to start. Once you have your test harness you can start to profile the individual components and subcomponents to see where the time is spent.
In a test environment it is much easier to perform experiments such as turning off garbage collection, or increasing the start and maximum heap sizes.
The observations from your experiments will give you new ideas on where to look and further experiments to perform.