From: Arjun Subject: Re: (Further timing queries) Re: Strange behavior of simple loop programs in Xen guests. Date: Sun, 16 Apr 2006 22:02:14 -0400 Message-ID: <896ae46a0604161902o61fcf4aeo9e8beabc03832e59@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1904645841==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --===============1904645841== Content-Type: multipart/alternative; boundary="----=_Part_19524_19643310.1145239334031" ------=_Part_19524_19643310.1145239334031 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Anthony, Thanks for that. Are there any specific documents or links I can check out regarding this issue ? I have another query along these lines : I have a simple java "Echo" client and server. In the client, I send a message of specific size to the server which echoes it back to the client and time the response. I use the java "System.currentTimeMillis()" function before and after the echo to measure the round-trip-time (RTT). Question is : if both my client and server programs are running inside Xen 3.0 guests, are the timing results trustworthy ? (Note that I'm measuring on a millisecond scale and am using the jdk1.5) Thanks and regards Arjun On 4/15/06, Anthony Liguori wrote: > > You're experience a well known problem with just about any piece of > virtualization software. > > Tools that run in the guest (like sar and top) do not realize that the > guest isn't always running which means they don't take this into account > when calculating percentages. This makes the output from them pretty muc= h > useless in a virtualized environment. > > The IBM zSeries Linux port has some special modifications to take this > trait into account within the kernel so tools like top work like you'd > expect. I believe someone was looking into doing something like this for > Xen. > > Regards, > > Anthony Liguori > > On Sat, 15 Apr 2006 02:57:26 -0400, Arjun wrote: > > > Hi, > > > > I'm running some simple C programs in a Xen 3.0 guest. I have a program > > testprog.c containing simple nested loops (see code below). I run this > > program and check "sar" and "top" output inside the guest and also > xentop > > on the host. It shows that the running program takes up almost all the > CPU > > time as expected. > > > > Now I introduce a sleep(1) statement inside my outer loop. On running > the > > modified program, both "sar" and "top" in the guest VM show 0% and > xentop > > on the host shows about 0.5% > > Next I start about a 100 instances of my loop program (started at skewe= d > > times) inside the guest VM. A check on sar and top still shows 0% CPU, > > however a check on xentop on the host shows an increase in CPU usage fo= r > > the guest. This changes with the number of instances of the loop progra= m > I > > start (more or less linearly). > > > > I don't understand why this is happening. Why are sar and top showing > > incorrect output in the guest VM. Can anyone explain ? > > > > P.S: code for the programs is posted below. > > > > Thanks and regards > > Arjun > > > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > ------=_Part_19524_19643310.1145239334031 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Anthony,

Thanks for that. Are there any specific documents or links = I can check out regarding this issue ?

I have another query along th= ese lines :

I have a simple java "Echo" client and server.= In the client, I send a message of specific size to the server which echoe= s it back to the client and time the response. I use the java " System.currentTimeMillis()" function before and after the echo to meas= ure the round-trip-time (RTT). Question is : if both my client and server p= rograms are running inside Xen 3.0 guests, are the timing results trustwort= hy ?  (Note that I'm measuring on a millisecond scale and am using the= =20 jdk1.5)

Thanks and regards
Arjun


On 4/15/06, Anthony Liguori &= lt;aliguori@us.ibm.com> wrote= :
You're experience= a well known problem with just about any piece of
virtualization softwa= re.

Tools that run in the guest (like sar and top) do not realize that = the
guest isn't always running which means they don't take this into acc= ount
when calculating percentages.  This makes the output from= them pretty much
useless in a virtualized environment.

The IBM zSeries Linux port= has some special modifications to take this
trait into account within t= he kernel so tools like top work like you'd
expect.  I believe= someone was looking into doing something like this for
Xen.

Regards,

Anthony Liguori

On Sat, 15 Apr 2006 = 02:57:26 -0400, Arjun wrote:

> Hi,
>
> I'm running so= me simple C programs in a Xen 3.0 guest. I have a program
> testprog.= c containing simple nested loops (see code below). I run this
> progra= m and check "sar" and "top" output inside the guest and= also xentop
> on the host. It shows that the running program takes u= p almost all the CPU
> time as expected.
>
> Now I introduce a sleep(1) state= ment inside my outer loop. On running the
> modified program, both &q= uot;sar" and "top" in the guest VM show 0% and xentop
> on the host shows about 0.5%
> Next I start about a 100 instance= s of my loop program (started at skewed
> times) inside the guest VM.= A check on sar and top still shows 0% CPU,
> however a check on xent= op on the host shows an increase in CPU usage for
> the guest. This changes with the number of instances of the loop p= rogram I
> start (more or less linearly).
>
> I don't und= erstand why this is happening. Why are sar and top showing
> incorrec= t output in the guest VM. Can anyone explain ?
>
> P.S: code for the programs is posted below.
>
>= ; Thanks and regards
> Arjun
>



_________________= ______________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
<= br> ------=_Part_19524_19643310.1145239334031-- --===============1904645841== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1904645841==--