Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: JVM Performance
PostPosted: Thu Sep 13, 2012 3:03 am 
Offline
Senior Newbie
User avatar

Joined: Tue Dec 23, 2003 4:37 am
Posts: 8
Website: http://www.inthetour.com
I just need some general advice on whether there is anything I can do to improve performance of my java program on my Linode or whether the performance I'm getting compared to my desktop environment is to be expected.

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


Top
   
 Post subject: Re: JVM Performance
PostPosted: Thu Sep 13, 2012 4:44 am 
Offline
Senior Member
User avatar

Joined: Tue Mar 17, 2009 5:11 am
Posts: 129
Location: UK
Your home machine is running HotSpot, can you install the official "oracle" version of the JDK and compare?

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?


Top
   
 Post subject: Re: JVM Performance
PostPosted: Thu Sep 13, 2012 9:57 am 
Offline
Senior Member

Joined: Sun May 23, 2010 1:57 pm
Posts: 315
Website: http://www.jebblue.net
Adding to Mr. Nod's comments, you might want to uninstall Java 7 and install Java 6 and compare too but definitely using the Oracle Java 7 or 6 version I would think should give better performance.

You can use update-alternatives to switch between versions and compare.


Top
   
 Post subject: Re: JVM Performance
PostPosted: Thu Sep 13, 2012 6:02 pm 
Offline
Senior Newbie
User avatar

Joined: Tue Dec 23, 2003 4:37 am
Posts: 8
Website: http://www.inthetour.com
Thank you for your input, guys.

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


Top
   
 Post subject: Re: JVM Performance
PostPosted: Thu Sep 13, 2012 8:58 pm 
Offline
Senior Member

Joined: Sun May 23, 2010 1:57 pm
Posts: 315
Website: http://www.jebblue.net
You could log in with ssh -X user@host and run jvisualvm, it comes with Java SDK and is nicer than jconsole. It might give you some helpful information.

Look into Java profiling tools, jvisualvm has one.

http://visualvm.java.net/gettingstarted.html


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group