Glassfish Performance, OpenJDK vs Sun JDK

I recently got a retired Dell Poweredge 600SC server from a local company.  This machine had a single Intel Pentium 4, 1.8GHz processor, with 1.5G SDRAM.  In terms of hardware, it's better than my old server machine (with 400MHz processor, 1G RAM), in which the Glassfish application server was installed to serve this blog and our online store application.   These java-based applications ran well in my old server and I would think that they would have better performance on the Dell machine.  I started to setup this Dell machine to replace the old server. 

The first problem that I encountered with the Dell machine was that I had problem installing the current version of Ubuntu into it.  I first tried to install Ubuntu 9.04, the same version in the old machine, but it faild to install.  Then I tried to install Ubuntu 10.04, the newest Ubuntu version as of this writing.  It also failed to install.  At last, I tried the Unbuntu 8.04 LTS version and it finally worked.   I was not sure why this Dell Poweredge 600SC couldn't install Ubuntu version newer than 8.04 version.  If you know the reason or know how to install the newer version on the Dell Poweredge 600SC,  please let me know.  I would appreciate your information very much!

After installing the Ubuntu server operating system, I tried to install the Glassfish Java application server.  I had an option to install either OpenJDK 6 or Sun JDK 6 for it first.  The Glassfish application server in the old machine ran on OpenJDK 6, the default option when installing the Glassfish application server.  Hoping it would perform better with Sun JDK 6, I installed Sun JDK 6 for the Glassfish application server this time.  The Glassfish application worked as I expected.  However, I realized at once that our online store application loaded slower than usual.  This application ran on Java EJB extensively and it took a few more seconds to load and initialize when compared with the old machine.  Checking the application logs on both machines confirmed my observations.   The time to perform the same operation in the Dell machine was in the magnitude of a few hundred milliseconds while it was in just a few ten milliseconds in the old machine!  I then ran some MySql tests to check the database performance on both machines.  MySql in the Dell machine indeed ran faster, cutting half of its time to run the same query in the old machine.  What made the application so slow in my new machine?  Would it be the Java version?  

I then installed the OpenJDK 6 to the Dell machine with: sudo apt-get install openjdk-6-jdk.  After a reboot, it worked!  The application finally picked up its speed as it should be.  It's a mystery to me that Glassfish(v2) in Ubuntu would behave in that way.  My guess was that the binary byte codes of Glassfish(v2) from Ubuntu were compiled with OpenJdk 6.  So using OpenJdk 6 might have advantages over Sun's Jdk 6. 

Now that the machine had two Java virtual machines installed in it, Sun Jdk 6 and OpenJdk 6,  I could choose which one to use with the following command in Ubuntu. sudo update-alternatives --config java


fshell 发布于  2010-6-28 10:16 

秋天来了

如果有人问我, 你愿意跟思想复杂的或与敏感的朋友交流?  我会倾向于选前者.  前者虽思想复杂, 但一经理顺, 大家还是可就事论事, 各述其见.  最坏的, 顶多是互不相让, 各持己见而尔.  与敏感的朋友交流却比较费心, 你说某门子的事, 对方会立刻会联想另一门他们敏感的事, 总怀疑话是冲着我来的.  久而久之, 每次交流, 你先得考虑这话要不要说, 怎说, 就怕对方听后可能又想歪了. 说了不如不说. 说了, 可能还要承受对方想歪后的后果.  如果你可能是这种比较敏感的朋友, 我愿意跟你分赏我的感想:  当你看到迎风而下的落叶时, 那就让它自己轻轻地飘落在地上吧! 只是秋天来了.


fshell 发布于  2010-6-21 15:28