JVM Performance
My java program will ultimately used in a JRuby on Rails web app but most of the intensive execution time is within java so I am just running and timing the java class from the command line for purposes of determining performance.
The class is a card game simulator. So it runs over the same methods 500K times but uses virtually no IO and not much memory.
DEVELOPMENT MACHINE
My home/development machine is a Mac Pro Dual Core 2.66 GHz (6 gb of RAM) running OSX Snow Leopard. The output of 'java -version' is:
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-10M3720)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode)
LINODE
My Linode (512 Plan) is running distro Ubuntu 12.04 LTS that I recently created. I installed OpenJDK via apt-get. Output of 'java -version' is:
java version "1.7.0_03"
OpenJDK Runtime Environment (IcedTea7 2.1.1pre) (7~u3-2.1.1~pre1-1ubuntu3)
OpenJDK Client VM (build 22.0-b10, mixed mode, sharing)
PERFORMANCE DIFFERENCE
The same calculations consistently take about 50% longer on my Linode compared with my home machine. This may be perfectly normal considering the hardware and expected performance of a Linode. That is what I don't know. It doesn't seem like an upgrade (of the Linode plan) would change this result considering my application does not use a lot of memory, but I am also unsure of that.
I would appreciate any input on what I can do to improve my Linode performance or whether this is just a normal experience that I should expect.
Thanks,
Mark
4 Replies
Also your home machine is more or less "yours" - on a linode512 you're sharing resources with 39 other users. For a better comparison you should upgrade your linode plan so that there is less contention for the resources.
Forgot to mention - have you adjusted your java heap size on your home machine which isn't the same as that on your linode?
You can use update-alternatives to switch between versions and compare.
I have tried Oracle's JVM, both 6 and 7. I have also tried varying heap sizes on both machines. Under all variations the performance (and performance difference) is similar to as originally reported.
This leaves an upgrade as the only other possibility. Would this be likely to help though? The only difference in specs in the pricing grid is RAM and disk space and bandwidth. Do higher plans necessarily get more CPU cycles per unit of time?
EDIT: Never mind I think I find where it says 10 less users for the next available plan. I think for me the only real option other than improving the application itself is seeing if some other type of VPS or environment works better for my application.
Mark
Look into Java profiling tools, jvisualvm has one.