From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Guthro Subject: Re: Xen 3.1.2 domU clock goes out of sync Date: Tue, 20 Nov 2007 08:49:44 -0500 Message-ID: <4742E5F8.40200@virtualiron.com> References: <20071119162849.U32489@zhuryrwn.rrarg.rr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0122836927==" Return-path: In-Reply-To: <20071119162849.U32489@zhuryrwn.rrarg.rr> 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: =?ISO-8859-1?Q?T=F5nu_Raitviir?= Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --===============0122836927== Content-Type: multipart/alternative; boundary="------------000708090400020406070200" This is a multi-part message in MIME format. --------------000708090400020406070200 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Clock skew is a known problem in virtualized systems. VMWare wrote a whitepaper a while back which goes into some of the=20 problems that they faced while dealing with this same issue... http://www.vmware.com/pdf/vmware_timekeeping.pdf The Xen project is not immune to these problems - however, some efforts=20 have been made recently on the list to address some of these issues See these threads: http://lists.xensource.com/archives/html/xen-devel/2007-10/msg01010.html http://lists.xensource.com/archives/html/xen-devel/2007-11/msg00554.html What it basically comes down to is that it is necessary to keep the=20 clock skew under 0.05% for NTP to work - so that was the design goal. The code introduced by some recent patches claims to be accurate to=20 0.02% (for at least HVM guests) Hope this helps. Ben T=F5nu Raitviir wrote: > > > Hello! > I have understood that when /proc/sys/xen/independent_wallclock is 0,=20 > then domU clock stays in sync with dom0 clock. Now I have a case with=20 > Xen 3.1.2 (also occured with 3.1.1, but I haven't documented it) where=20 > domU clock runs significantly faster - after 65 hours domU clock is 20=20 > seconds ahead of dom0 clock. > In this case dom0 is not running ntpd. When ntpd is running on dom0,=20 > domU clock also stays correct. Is this normal behaviour? > > Some examples to show clock differences: > > domU# uptime > 14:54:09 up 2 days, 17:05, 1 user, load average: 0.75, 0.49, 0.43 > > domU# ntpdate -q ntp.eenet.ee > server 193.40.133.142, stratum 1, offset -20.856732, delay 0.02579 > 19 Nov 14:54:13 ntpdate[8467]: step time server 193.40.133.142 offset=20 > -20.856732 sec > > dom0# uptime > 14:55:02 up 2 days, 17:06, 1 user, load average: 0.07, 0.02, 0.00 > > dom0# ntpdate -q ntp.eenet.ee > server 193.40.133.142, stratum 1, offset -0.438055, delay 0.02589 > 19 Nov 14:55:17 ntpdate[32284]: adjust time server 193.40.133.142=20 > offset -0.438055 sec > > > Xen version used: > > Xen version 3.1.2 (jussuf@localdomain) (gcc version 4.1.2 20061115=20 > (prerelease) (Debian 4.1.1-21)) Fri Nov 16 17:52:59 EET 2007 > Latest ChangeSet: Wed Nov 14 23:35:43 2007 +0000 15502:c6776b6da8ee > > Linux xen-2 2.6.18.8-xen0 #1 SMP Fri Nov 16 17:39:31 EET 2007 x86_64=20 > GNU/Linux > > -----------------------------------------------------------------------= - > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > =20 --------------000708090400020406070200 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Clock skew is a known problem in virtualized systems.

VMWare wrote a whitepaper a while back which goes into some of the problems that they faced while dealing with this same issue...
http://www.vmware.com/pdf/vmware_timekeeping.pdf

The Xen project is not immune to these problems - however, some efforts have been made recently on the list to address some of these issues

See these threads:
http://lists.xensource.com/archives/html/xen-devel/2007-10/msg01010.html
http://lists.xensource.com/archives/html/xen-devel/2007-11/msg00554.html

What it basically comes down to is that it is necessary to keep the clock skew under 0.05% for NTP to work - so that was the design goal.

The code introduced by some recent patches claims to be accurate to 0.02% (for at least HVM guests)


Hope this helps.

Ben


Tõnu Raitviir wrote:


Hello!
I have understood that when /proc/sys/xen/independent_wallclock is 0, then domU clock stays in sync with dom0 clock. Now I have a case with Xen 3.1.2 (also occured with 3.1.1, but I haven't documented it) where domU clock runs significantly faster - after 65 hours domU clock is 20 seconds ahead of dom0 clock.
In this case dom0 is not running ntpd. When ntpd is running on dom0, domU clock also stays correct. Is this normal behaviour?

Some examples to show clock differences:

domU# uptime
 14:54:09 up 2 days, 17:05,  1 user,  load average: 0.75, 0.49, 0.43

domU# ntpdate -q ntp.eenet.ee
server 193.40.133.142, stratum 1, offset -20.856732, delay 0.02579
19 Nov 14:54:13 ntpdate[8467]: step time server 193.40.133.142 offset -20.856732 sec

dom0# uptime
 14:55:02 up 2 days, 17:06,  1 user,  load average: 0.07, 0.02, 0.00

dom0# ntpdate -q ntp.eenet.ee
server 193.40.133.142, stratum 1, offset -0.438055, delay 0.02589
19 Nov 14:55:17 ntpdate[32284]: adjust time server 193.40.133.142 offset -0.438055 sec


Xen version used:

Xen version 3.1.2 (jussuf@localdomain) (gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) Fri Nov 16 17:52:59 EET 2007
Latest ChangeSet: Wed Nov 14 23:35:43 2007 +0000 15502:c6776b6da8ee

Linux xen-2 2.6.18.8-xen0 #1 SMP Fri Nov 16 17:39:31 EET 2007 x86_64 GNU/Linux


_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel

--------------000708090400020406070200-- --===============0122836927== 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 --===============0122836927==--