Weblog entry #14 for dkg

Insane clock skew on amd64 host running etch/i386
Posted by dkg on Fri 2 Feb 2007 at 02:07
Tags:
My impression was that the i386 debian distribution could run fine on an amd64 processor (though i recognize that it wouldn't get the full benefit of the 64-bit platform).

I have a machine which i'm trying to do this on, though, and while it's up and running, i'm getting serious clock skew: something like 10x real time. The machine is running stock debian etch, as up-to-date as you can get it, with a 2.6.18-3-686 kernel.

Interestingly, the hardware clock is stable, and very close to real time. I think i might just be getting way too many timer interrupts or something. Any suggestions about what to do? Somehow, i don't think ntp was designed to handle a skew of 10 seconds per second.

Here's a debugging attempt where you can see the skew:

0 orangutan:~# hwclock --hctosys; for foo in 1 2 3 4; do
>    date +%c
>    hwclock --show
>    ntpdate -q -u sundial.columbia.edu
>    sleep 10
> done
Thu 01 Feb 2007 09:05:53 PM EST
Thu 01 Feb 2007 09:05:54 PM EST  -0.997837 seconds
server 128.59.59.177, stratum 2, offset -2.570964, delay 0.40991
 1 Feb 21:05:55 ntpdate[6909]: step time server 128.59.59.177 offset -2.570964 sec
Thu 01 Feb 2007 09:06:05 PM EST
Thu 01 Feb 2007 09:05:55 PM EST  -0.256843 seconds
server 128.59.59.177, stratum 2, offset -13.593056, delay 0.41589
 1 Feb 21:06:07 ntpdate[6913]: step time server 128.59.59.177 offset -13.593056 sec
Thu 01 Feb 2007 09:06:17 PM EST
Thu 01 Feb 2007 09:05:56 PM EST  -0.252818 seconds
server 128.59.59.177, stratum 2, offset -24.668502, delay 0.41322
 1 Feb 21:06:19 ntpdate[6917]: step time server 128.59.59.177 offset -24.668502 sec
Thu 01 Feb 2007 09:06:29 PM EST
Thu 01 Feb 2007 09:05:57 PM EST  -0.256849 seconds
server 128.59.59.177, stratum 2, offset -35.685214, delay 0.41321
 1 Feb 21:06:31 ntpdate[6921]: step time server 128.59.59.177 offset -35.685214 sec
0 orangutan:~# 
Any suggestions? What should i be looking for?

 

Comments on this Entry

Posted by dkg (216.254.xx.xx) on Fri 2 Feb 2007 at 02:11
[ Send Message | View dkg's Scratchpad | View Weblogs ]
Here's the full contents of /etc/adjtime, if that's relevant:
0.000000 1170381475 0.000000
1170381475
UTC
I'm afraid i'm not sure how to interpret it.

[ Parent | Reply to this comment ]

Posted by Magelite (58.163.xx.xx) on Fri 2 Feb 2007 at 11:50
[ Send Message ]
Have you tried changing the kernel clock source?

I was getting a terrible clock skew problem while running Debian Sarge as a virtual machine with MS Virtual Server 2005 R2.

The time skew problem was solved by adding clock=pit to the bootloader.

Details of the clock parameter can be found in kernel-parameters.txt.gz from the linux-doc package.

        clock=          [BUGS=IA-32, HW] gettimeofday clocksource override.
                        [Deprecated]
                        Forces specified clocksource (if avaliable) to be used
                        when calculating gettimeofday(). If specified
                        clocksource is not avalible, it defaults to PIT.
                        Format: { pit | tsc | cyclone | pmtmr }

[ Parent | Reply to this comment ]

Posted by dkg (216.254.xx.xx) on Fri 2 Feb 2007 at 15:19
[ Send Message | View dkg's Scratchpad | View Weblogs ]
Thank you so much! i added clock=pit to the # kopt= line in /boot/grub/menu.lst, ran update-grub, and rebooted. It looks like things are fixed. (i'll read up more on that option so i understand it better, too):
0 orangutan:~# hwclock --hctosys; for foo in 1 2 3 4; do
>    date +%c
>    hwclock --show
>    ntpdate -q -u sundial.columbia.edu
>    sleep 10
> done
Fri 02 Feb 2007 10:11:37 AM EST
Fri 02 Feb 2007 10:11:38 AM EST  -0.997767 seconds
server 128.59.59.177, stratum 2, offset -0.898535, delay 0.04990
 2 Feb 10:11:38 ntpdate[2520]: step time server 128.59.59.177 offset -0.898535 sec
Fri 02 Feb 2007 10:11:48 AM EST
Fri 02 Feb 2007 10:11:49 AM EST  -0.768946 seconds
server 128.59.59.177, stratum 2, offset -0.898470, delay 0.04987
 2 Feb 10:11:49 ntpdate[2524]: step time server 128.59.59.177 offset -0.898470 sec
Fri 02 Feb 2007 10:11:59 AM EST
Fri 02 Feb 2007 10:12:00 AM EST  -0.776830 seconds
server 128.59.59.177, stratum 2, offset -0.898535, delay 0.04991
 2 Feb 10:12:00 ntpdate[2565]: step time server 128.59.59.177 offset -0.898535 sec
Fri 02 Feb 2007 10:12:10 AM EST
Fri 02 Feb 2007 10:12:11 AM EST  -0.776747 seconds
server 128.59.59.177, stratum 2, offset -0.898532, delay 0.04984
 2 Feb 10:12:11 ntpdate[2569]: step time server 128.59.59.177 offset -0.898532 sec
0 orangutan:~# 
I had suspected a virtualized environment earlier (the hosting company is claiming that this is a real machine, but i've never seen it). Your comment makes me even more suspicious. Do you know how to detect if you are running within an MS Virtual Server? I've tried scoopy doo, which is billed as being able to detect a VMWare instance, but it doesn't detect anything.

Thanks again!

[ Parent | Reply to this comment ]

Posted by dkg (216.254.xx.xx) on Fri 2 Feb 2007 at 18:39
[ Send Message | View dkg's Scratchpad | View Weblogs ]
funny clocks and virtualization seem like they go together with VMWare as well as MS Virtual Server.

A year ago, Ben Armstrong of MS was claiming that then MS Virtual Server environment could be detected by a hardware scan, but it's not clear to me how to translate his VB into something i can run on debian, though i've tried a little bit:

0 orangutan:~# lshw -class system
orangutan                    
    description: Desktop Computer
    product: MS-7191
    vendor: MSI
    version: 1.0
    serial: To Be Filled By O.E.M.
    width: 32 bits
    capabilities: smbios-2.3 dmi-2.3
    configuration: chassis=desktop uuid=00020003-0004-0005-0006-000700080009
0 orangutan:~# 

[ Parent | Reply to this comment ]

Posted by dkg (216.254.xx.xx) on Fri 2 Feb 2007 at 18:43
[ Send Message | View dkg's Scratchpad | View Weblogs ]
Here's the reference to MS Virtual Server clock skew, with the same clock=pit suggestion.

[ Parent | Reply to this comment ]

Posted by Magelite (58.163.xx.xx) on Sat 3 Feb 2007 at 02:16
[ Send Message ]
Good news is, that MS don't seem to be hiding their VMM status

vmdebian:~# lshw -class system
vmdebian
    description: Desktop Computer
    product: Virtual Machine
    vendor: Microsoft Corporation
    version: VS2005R2
    serial: 6241-9319-3528-4190-6131-5224-30
    width: 32 bits
    capabilities: smbios-2.3 dmi-2.3
    configuration: boot=normal chassis=desktop uuid=4482F20C-B3F4-3F42-9665-4F3F5C30E6A2
Bad news is that still leaves you in the dark with the cause of your clock skew :(

[ Parent | Reply to this comment ]

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search