VMware
1 2 Previous Next 22 Replies Last post: Sep 18, 2009 7:45 AM by tcutts   Go to original post

Re: Java Performance on VMware ESX

15. Aug 4, 2009 7:08 AM in response to: jjmurray
Click to view tcutts's profile Novice 24 posts since
Sep 1, 2008
jjmurray wrote:

Hi,

One possible cause to rule out here is the circumstance shown in https://bugzilla.redhat.com/show_bug.cgi?id=492018 which describes a Futex problem with another flavor f Linux on physical systems.


This may be contributing to the issue - let's rule it out or in.

That seems to be a gtk/x11 issue, which is not relevant in my case - these are tomcat JSP servers.

Is the application doing a large amount of GC in any case - i.e more than once a second. That may account for the high number of calls to gettimeofday() which is an expensive call.

is there any way I can find that out from a running tomcat process? Please bear in mind that I'm not a java expert, but a mere sysadmin. I suspect jstat is what I want to use, but the documentation is less than clear, and I don't really know how to interpret the output.

Tim

Re: Java Performance on VMware ESX

16. Aug 4, 2009 7:16 AM in response to: tcutts
Click to view tommyodom's profile Novice 6 posts since
Jul 19, 2009

There are a few java command line options you can use to turn on garbage collection information but I don't know whether or not they would have performance impacts in your situation. If you are running the Sun JVM, the three flags that may be of use to you are:

-verbose:gc
prints information at every collection

-XX:+PrintGCDetails prints additional information about the collections

-XX:+PrintGCTimeStamps
will additionally print a time stamp at the start of each collection

Any of those three flags should output information to tell you how frequently garbage collection is running.

Re: Java Performance on VMware ESX

17. Aug 7, 2009 9:30 AM in response to: jjmurray
Click to view tcutts's profile Novice 24 posts since
Sep 1, 2008
jjmurray wrote:

Hi,

One possible cause to rule out here is the circumstance shown in https://bugzilla.redhat.com/show_bug.cgi?id=492018 which describes a Futex problem with another flavor f Linux on physical systems.

This may be contributing to the issue - let's rule it out or in.

Is the application doing a large amount of GC in any case - i.e more than once a second. That may account for the high number of calls to gettimeofday() which is an expensive call.


I've checked, and the application is not doing a great deal of GC. Even less, when I used -Xmx and -Xms to increase the memory it's using. The problem persisted.

Most of the application performs fairly well; the parts that don't are those which interact with the back end database (on a physical server). When we performed packet capture of the communication between the virtualised app and the Oracle server, and compared it with the same thing on the non-virtualised app, we did notice that the virtualised app used three times as many packets as the non-virtualised app. Total data size was about the same, so it looks like smaller packets. So I'm starting to wonder whether this might possibly be something to do with the virtualised network and packet sizes? But if that were the case, why are we only seeing this with Java applications? What controls this packet size? There seem to be several layers, any of which could be at fault: Tomcat -> JDBC -> Oracle client libraries -> Linux kernel -> ESX and probably other layers I haven't thought of. Certainly we haven't seen performance issues with other Java applications where the database is internal to the VM, such as our Confluence server. Only with tomcat servers contacting external Oracle instances, and with a web indexing application which uses java to spider the site's pages. Perhaps it's a general problem with network connections which are initiated by the JVM in the virtualised environment? I will do some more investigation, since if that's the case, I can come up with a simpler test case which will make it easier for you to reproduce.

Re: Java Performance on VMware ESX

18. Aug 19, 2009 10:16 PM in response to: tcutts
Click to view SlaytanicLemmy's profile Lurker 2 posts since
Feb 6, 2006

Did you find any more information on the possible JVM-Network issue that you were investigating? We have many tomcat-based applications running in JVMs and recently, there has been a reported slowdown. They do not push the CPU at all, but they do use back-end JDBC Oracle/MS-SQL DBs. If this is an issue, I want to be able to escalate internally and within VMware.

We do not have the luxury of being able to move the apps to a physical environment. We are using JVM jdk1.5.0_14-b03 (64-bit) on RHEL 4.8 (64-bit) 2vCPU.

Any input would greatly enhance additional troubleshooting that we would perform to validate.

Re: Java Performance on VMware ESX

19. Aug 24, 2009 3:03 AM in response to: tcutts
Click to view otarroux's profile Lurker 1 posts since
Aug 24, 2009

Hi have a very similar issue with an in-house developped java application, running on a RHEL 5.3 guest on VmWare 3.5 U4 on a 16 core host.

The application is consuming a lot of system time, and is slow compared to a similar physical box.

Typically : CPU USR around 15 %, CPU SYS around 50%.

There is no WaitIO, no swapping, no ballooning, lot of available RAM.

Java spent most of the time in the system with "futex" and "poll" calls :

{size:10pt}{font:Courier New}% time seconds usecs/call
calls errors syscall


-----------
---------
----------------
49.99 163.781588 26907
6087 1240 futex
41.07 134.545105 17489
7693
poll

7.00 22.928262 532 43077 recvfrom
1.36 4.469311 372443 12
accept
0.48 1.566032 53 29513 sendto

We have checked the appropriate time settings are applied :

  • notsc divider=10 in the kernel parameters
  • ntp time sync instead of vmware tools time sync

We have tested with 1 vCPU and 4 vCPU : % CPU sys is better in 4vCPU, but still much higher that usual.

Since the physical box behaves much better, I would not suspect the application to be badly written.

Then I don't know if the problem comes from java or from VwMare or from RHEL.

Would a formal ticket at Vmware help ?

Re: Java Performance on VMware ESX

20. Sep 17, 2009 6:01 AM in response to: SlaytanicLemmy
Click to view tcutts's profile Novice 24 posts since
Sep 1, 2008
SlaytanicLemmy wrote:

Did you find any more information on the possible JVM-Network issue that you were investigating? We have many tomcat-based applications running in JVMs and recently, there has been a reported slowdown. They do not push the CPU at all, but they do use back-end JDBC Oracle/MS-SQL DBs. If this is an issue, I want to be able to escalate internally and within VMware.

We do not have the luxury of being able to move the apps to a physical environment. We are using JVM jdk1.5.0_14-b03 (64-bit) on RHEL 4.8 (64-bit) 2vCPU.

Any input would greatly enhance additional troubleshooting that we would perform to validate.


I have now completed my migration to ESX 4.0, and while the performance of some java applications does seem to have improved (notably Lucene) at least one of my users is still reporting tomcat application poor performance. I am trying to arrange a meeting with the user at the moment to narrow down where the performance problem is. The difficulty is that we're dealing with a vast number of layers of code here, any one of which might be having trouble in the virtualised environment:

The user's own java code
Tomcat
JDBC
The JVM
The Oracle client libraries
The OS itself
The virtual network card in the guest
The virtual switch

to name a few. We're all using different distributions, so unless it's a fundamental problem with Linux itself, I think we can discount that. I've also tried several java versions, with no change, so it isn't that, again unless there's a fundamental problem with Java on ESX guests, which I don't believe.

I've asked the user to give me:

a) The SQL query that's slow (so I can use it directly with sqlplus, and see if it's the Oracle client stack or below that's causing it)
b) A tiny CLI java app which uses JDBC to make that same query (which should tell us whether it's JDBC-related, or something in the higher user code)

I've also asked the user to put some instrumentation into their code to time various sections, so they can really tell me where the slowdown is. The application is quite large and complex, and the reports are really just nebulous "it's too slow" reports.

I'll let you know what results I get from the above tests, if the user supplies me with some code.

If any of you have done anything like the above analysis, I'd like to hear results.

Re: Java Performance on VMware ESX

22. Sep 21, 2009 7:43 AM in response to: haroldr
Click to view tcutts's profile Novice 24 posts since
Sep 1, 2008
Having gone through those best practices, yes, we're on board with all of them.

The only variable we have here is the 'hardware' platform on which the tomcat java service is running. The software is on an NFS server, so both physical and virtual servers are getting their tomcat copy from the same place. The same goes for the Oracle client software. The Oracle server is on a physical machine, and is the same for both the physical and virtual clients. The OS installed on the physical and virtual machines is also identical, with the exception of some of the device driver modules in use, a natural consequence of virtualising the system.

So we have already controlled for most variables. I'm still waiting for the broken-down code snippets from the users.

Tim

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities