From owner-freebsd-stable@FreeBSD.ORG Thu Feb 11 19:49:44 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CA061065672; Thu, 11 Feb 2010 19:49:44 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [IPv6:2001:470:a803::1]) by mx1.freebsd.org (Postfix) with ESMTP id ABA6C8FC13; Thu, 11 Feb 2010 19:49:43 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id ACF49A56C95; Fri, 12 Feb 2010 03:49:42 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id njV4tgkEgGvz; Fri, 12 Feb 2010 03:49:37 +0800 (CST) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id DBBFBA56C6F; Fri, 12 Feb 2010 03:49:35 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=WA88Um94ALJ0+s/H39CtDaPyiPFyz5tF+36H2cf/BA63XXkoKJQPj7aizxEurVGKJ Lpn9j7ULD92ghnVDXCNIg== Message-ID: <4B745F4B.3090201@delphij.net> Date: Thu, 11 Feb 2010 11:49:31 -0800 From: Xin LI Organization: The Geek China Organization User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.7) Gecko/20100207 Thunderbird/3.0.1 ThunderBrowse/3.2.8.1 MIME-Version: 1.0 To: Jeremy Chadwick References: <20100211190652.6a66c618.torfinn.ingolfsen@broadpark.no> <20100211192515.GB13854@icarus.home.lan> In-Reply-To: <20100211192515.GB13854@icarus.home.lan> X-Enigmail-Version: 1.0 OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-stable@freebsd.org, jkim@FreeBSD.org Subject: Re: ntpd struggling to keep up - how to fix? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 19:49:44 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, On 2010/02/11 11:25, Jeremy Chadwick wrote: > On Thu, Feb 11, 2010 at 07:06:52PM +0100, Torfinn Ingolfsen wrote: >> Hi, >> >> One of my machines, the fileserver-with-zfs-to-be[1] has trouble >> keeping correct time. Or rather, ntpd is struggling. >> In /var/lkog/messages I see this: >> Feb 7 12:05:54 kg-f2 ntpd[909]: ntpd 4.2.4p5-a (1) >> Feb 7 12:11:16 kg-f2 ntpd[910]: time reset +1.020413 s >> Feb 7 12:11:16 kg-f2 ntpd[910]: kernel time sync status change 2001 >> Feb 7 12:26:26 kg-f2 ntpd[910]: time reset +2.277793 s >> Feb 7 12:41:29 kg-f2 ntpd[910]: time reset +2.260229 s >> Feb 7 12:57:02 kg-f2 ntpd[910]: time reset +2.332972 s >> Feb 7 13:21:24 kg-f2 ntpd[910]: time reset +3.659869 s >> Feb 7 13:37:01 kg-f2 ntpd[910]: time reset +2.343230 s >> Feb 7 13:52:24 kg-f2 ntpd[910]: time reset +2.310659 s >> Feb 7 14:07:29 kg-f2 ntpd[910]: time reset +2.265705 s >> Feb 7 14:23:03 kg-f2 ntpd[910]: time reset +2.335868 s >> Feb 7 14:39:06 kg-f2 ntpd[910]: time reset +2.411116 s >> Feb 7 14:54:32 kg-f2 ntpd[910]: time reset +2.318222 s >> Feb 7 15:09:55 kg-f2 ntpd[910]: time reset +2.308120 s >> Feb 7 15:25:49 kg-f2 ntpd[910]: time reset +2.388391 s >> Feb 7 15:40:54 kg-f2 ntpd[910]: time reset +2.265464 s >> Feb 7 15:55:57 kg-f2 ntpd[910]: time reset +2.257952 s >> Feb 7 16:11:45 kg-f2 ntpd[910]: time reset +2.373325 s >> >> and this goes on an on, forever. At any give time, no matter how long the machine has been up, ntpq ca report this: >> root@kg-f2# ntpq -p >> remote refid st t when poll reach delay offset jitter >> ============================================================================== >> kg-omni1.kg4.no 129.240.64.3 3 u 13 64 37 0.162 703.094 444.681 >> >> Note: all machines on my LAN use my firewall as the ntp server. >> The ntp server runs FreeBSD, none of the other machines have any trouble keeping time. >> My workstation for example: >> tingo@kg-v2$ ntpq -p >> remote refid st t when poll reach delay offset jitter >> ============================================================================== >> *kg-omni1.kg4.no 129.240.64.3 3 u 44 64 377 0.138 4.018 0.338 >> (my workstatuion also runs FreeBSD 8.0-stable / amd64) >> >> The machine runs FreeBSD 8.0-stable / amd64: >> root@kg-f2# uname -a >> FreeBSD kg-f2.kg4.no 8.0-STABLE FreeBSD 8.0-STABLE #2: Sun Jan 31 18:39:17 CET 2010 root@kg-f2.kg4.no:/usr/obj/usr/src/sys/GENERIC amd64 >> >> So, how can I get the machine to keep time / get ntpd synchronised? >> >> References: >> 1) hw info: http://sites.google.com/site/tingox/ga-ma74gm-s2h >> 2) FreeBSD info: http://sites.google.com/site/tingox/ga-ma74gm-s2h_freebsd > > Your machine has a rapidly drifting clock, usually an indicator of a > hardware problem (crystal gone bad is a common one -- seen this at work > quite a few times), or possibly a bad time counter source chosen by the > kernel. Can you please provide the output of: > > sysctl kern.timecounter > > Finally, was this OS installation used on different hardware in the > past? Meaning: was the hard disk previously installed on another > machine? Why I'm asking: /var/db/ntpd.drift could be from an old > computer (the previous hardware), and the clock drift rate would be > different than that of your newer[1] hardware. If that's the case, > please stop ntpd, rm /var/db/ntpd.drift, and restart ntpd. Be aware it > will take up to 72 hours for the clock drift to be calculated correctly. I think this looks like the same problem I had with another AMD system, which may be related to some HPET stuff (I no longer have access to that system, though :( Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iQEcBAEBAgAGBQJLdF9LAAoJEATO+BI/yjfBqacH/jreDlSiX9YCZqOSo22Dx0oW KGxuqUk6ViBTBEMOHJzpqNn37u/cbBQ7qlXaDfhg1LY825lCvx782mFGPH3J67qT IQZyLeWKGn/2BW/mhyQ9qOkEZKfifuwGmvvhxOwmnPyG2o1opFYiNxtLcJj0hPbs qqhf7wE2YzY4Khx7bTVsbclUz6kaXnusUF09Kg2F4LJ7WUilkAvFYwuG/J4sx7UN qKbw/F2bS1suyAt3cOmcb73rHN8MAbIyzjv0HOc4LUMnS6btFPUe5pqa7ghRNf7o 4wIoeGXQ6zupkjpHULIjU9hfu8uwKnTiDJ2xfJ6HjLvawsvOu/VUYvgqQM6cMd8= =Wy4x -----END PGP SIGNATURE-----