From owner-freebsd-cloud@freebsd.org Thu Jan 19 01:10:23 2017 Return-Path: Delivered-To: freebsd-cloud@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E38D0CB62B9 for ; Thu, 19 Jan 2017 01:10:23 +0000 (UTC) (envelope-from bruce.walker@gmail.com) Received: from mail-oi0-x231.google.com (mail-oi0-x231.google.com [IPv6:2607:f8b0:4003:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7F66189C for ; Thu, 19 Jan 2017 01:10:23 +0000 (UTC) (envelope-from bruce.walker@gmail.com) Received: by mail-oi0-x231.google.com with SMTP id w204so16867683oiw.0 for ; Wed, 18 Jan 2017 17:10:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=NtG4grGv9zPvo0T8CeoNrGCBP0pOEmG/MjQjiqShmG0=; b=MKOzd7t7673AfQUkhGXpv8OTxKpuTMoT8Vk21wOr9BeTUcIpR7NAhjVTnw7C6GyrHx h5dT6P81Xk5L9BwL1k4HfyfL7gVzrx7YkynpJ/IuRMvwJxDgxuwNcDPyNfBzMXzvNMqZ ri32nmHFFN7gz5Z8+RuXRciWvhjedbbXV4h+S2hnNrYJv9emjNT/czZCQomYuyXqJKM8 Dbwipz8jzXAwQuEFr+BnZiLCAM0mMf2vlNZN6kOixvcjPOzTj4Ym64LfoE2YzRRqxILr VHhHvfZ730bJxZNHNtsL1mes2bb7FphuUGDME1KP1vb/lx0XYgS64bT0ybrCJcoBk9c4 aNKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=NtG4grGv9zPvo0T8CeoNrGCBP0pOEmG/MjQjiqShmG0=; b=dsoNXBP+qiVll7OJu9DBYp0eaIRuD3hsmwy74NvFRv1i4+I6j1cxNsIWwrkuJxD0B9 kE/Mvx4rk5F5za4HYbPZzhEGeiJ7Qj4zmiNtyhxaUOr+9JOaj3yXsPWuxnVKwTU5M4eV ktu+k2IsxDsM1CmX0ywo4qPzZEuu3r/uExpqKN9ANWNrUM0+DsypiLf6ZSo0aTMD6kX0 cvpO79fnVWKXTMVSHWabKDwb1xwz6ALi0rbDpsqegZ/il2lbhj710sRZ92Gw2T7dEXmV ZY1oICMKgoxjAZVNipBZ+7IQuZuUyTH7j2jb6J0uWHB2Sdibn94o2GPAM2mLjIlpHIaf pRrQ== X-Gm-Message-State: AIkVDXLur0DwEGvr7C1/WqP8Ya1WAz6phSTcGYVlffgBPuoqNlbuoRjSbXWB6UiPXG/WzBuYCKo38DtGMrqB2w== X-Received: by 10.202.73.78 with SMTP id w75mr2811923oia.19.1484788222708; Wed, 18 Jan 2017 17:10:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.129.136 with HTTP; Wed, 18 Jan 2017 17:10:21 -0800 (PST) From: Bruce Walker Date: Wed, 18 Jan 2017 20:10:21 -0500 Message-ID: Subject: GCE: significant clock drift - the solution To: freebsd-cloud@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-cloud@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "FreeBSD on cloud platforms \(EC2, GCE, Azure, etc.\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2017 01:10:24 -0000 Hi gang, first message. I am developing on Google Cloud Engine, I'm using the FreeBSD community image, and so far it's been pretty painless. Thank you! But I noticed that the system clock on one of my two instances was drifting fast over time, and I mean really fast. I estimate about 1 second ahead for every 20-30 seconds of elapsed time. So I would stop and restart ntpd and that would reset the time. Then the creep again ... Long story short: I searched the Google gce-discussion group and found another FreeBSD user with the same issue, and a solution was provided by one Andy Carrel. In a nutshell two system boot files need tweaks: /boot/loader.conf machdep.disable_tsc_calibration=1 kern.timecounter.invariant_tsc=1 /etc/sysctl.conf kern.timecounter.hardware=TSC-low Andy further explains: "The loader.conf changes instruct the kernel to not try to do calibration of the TSC, since this calibration could give bad results due to the virtualization, and to ignore the fact that the "invariant TSC" feature is not advertised by the CPU and just assume the CPU has this feature. The sysctl.conf change instructs the kernel to use the TSC-low timecounter which was made available by the loader.conf changes." For reference, here's a link to the posting: https://groups.google.com/forum/#!msg/gce-discussion/NKhl1QOVucQ/EDyLd_FxCAAJ Maybe these can make it back into the community cloud image. -- -bmw From owner-freebsd-cloud@freebsd.org Thu Jan 19 01:56:26 2017 Return-Path: Delivered-To: freebsd-cloud@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08B06CB76B8 for ; Thu, 19 Jan 2017 01:56:26 +0000 (UTC) (envelope-from bilbo@hobbiton.org) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B44831625 for ; Thu, 19 Jan 2017 01:56:25 +0000 (UTC) (envelope-from bilbo@hobbiton.org) Received: by mail-wm0-x235.google.com with SMTP id c85so269355732wmi.1 for ; Wed, 18 Jan 2017 17:56:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hobbiton-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=S4yuqu5/JAJ0X6d6LbYRwnjZQhSvPfuj35yg0fCJE+0=; b=KDh+qYqfCq4jZUlRCCan3RkyeBLfkHeDVc7oAXOCwjy2HK+DLkYNe0eAlfzHHbrUpL TjVP9CLn7aL1wJpiQZ425yS/G6nNhZmZ4Ds96gQ5AWH5flhGvR/rnMfJYdJjsiIeSrtI 1M2spFgPxx0LqzwpG3XtWpNiB15DMWco/kb7ARL9A3oCsAidwkFOvgmxlFuMkWfxt+ND TWk6Mb7AJKRWqWPmjrDuTn0B7OlhcFm27YkWoQOJjw6i1U/uR/3f+xt80H5j9beHQAYS wQu8nHqflj3qVbMfWZPIRjgjBAOJSKCe2ON3wDnaH2kfdjmqDt83T+UhfsJEwhmz4crN zA+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=S4yuqu5/JAJ0X6d6LbYRwnjZQhSvPfuj35yg0fCJE+0=; b=cLoBP9EN8uk9mKbfq119QiM3MzMd9Cjs1NR4gT6//a52nqPRMjFcskp/SKavop79OQ HvkTKvQ9/cO9LBsGk0MBAe6kcwROxLqbooQFLGWDbexfcQblQZEyqqu1EAcbr7jsYSBo mlgcumTlLCpDHmnPLfu7bNwKAspnIBXvfEigTZoKk+31GmXHNlGiPWwab+tVeuFN34O5 mmW9jKotvvJbQlfrZFEU4mvwqQ4FCM5JuJtlC1VYxWWBNQBsHt/0mPpll7W87kiRyg4a OYVDWeKCAk5gUZtCA7nBEUO4S+1otdm8Y/Dl6vH0cT3zFKD4yDCnzKh4g478dsQS6ESb aYHA== X-Gm-Message-State: AIkVDXJww81IhSi+XX+EsIcBEnNq+has7hxZ3mRYGmGXlXBVE8tlQ3GC6EfbIX+InwEfO0vmxcKjuRqDb1Zcjw== X-Received: by 10.28.131.132 with SMTP id f126mr12763887wmd.61.1484790983809; Wed, 18 Jan 2017 17:56:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.68.84 with HTTP; Wed, 18 Jan 2017 17:56:23 -0800 (PST) X-Originating-IP: [96.3.205.236] Received: by 10.28.68.84 with HTTP; Wed, 18 Jan 2017 17:56:23 -0800 (PST) In-Reply-To: References: From: Leif Pedersen Date: Wed, 18 Jan 2017 19:56:23 -0600 Message-ID: Subject: Re: GCE: significant clock drift - the solution To: Bruce Walker Cc: freebsd-cloud@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-cloud@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "FreeBSD on cloud platforms \(EC2, GCE, Azure, etc.\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2017 01:56:26 -0000 Just for others to learn from my head-pounding, heh: On 10.3, I've been using kern.timecounter.hardware=ACPI-safe I set it with sysctl after booting, then recorded it in sysctl.conf. No loader tweaking was necessary. Besides speculating from experience, I don't know which is best or why. I arrived at that by trying all the options until one kept the clock stable for me, after other suggestions didn't work consistently. I forgot which, but one option actually seemed to work for days, then made my VMs appear to hang because the virtual clock stopped ticking completely. Upon rebooting the clock seemed fine for a few more days. It was repeatable, and changing the setting decidedly stopped the problem. The takeaway I'm getting at is, picking the wrong thing can (or at least did) make for very weird symptoms. So it's something to suspect if you find that your VMs appear "unstable" in mysterious ways. I can imagine that things get pretty weird if the clock abruptly stops, leaving only IO events left to drive the kernel. Again, I'm not *advising* anyone to use my setting. But if you find you have seemingly unrelated stability problems or are just into jolly bizarre experiments, there's something to see here by selecting different hardware clocks. And it may vary by provider. I observed this on Google Compute Engine. -Leif On Jan 18, 2017 7:10 PM, "Bruce Walker" wrote: Hi gang, first message. I am developing on Google Cloud Engine, I'm using the FreeBSD community image, and so far it's been pretty painless. Thank you! But I noticed that the system clock on one of my two instances was drifting fast over time, and I mean really fast. I estimate about 1 second ahead for every 20-30 seconds of elapsed time. So I would stop and restart ntpd and that would reset the time. Then the creep again ... Long story short: I searched the Google gce-discussion group and found another FreeBSD user with the same issue, and a solution was provided by one Andy Carrel. In a nutshell two system boot files need tweaks: /boot/loader.conf machdep.disable_tsc_calibration=1 kern.timecounter.invariant_tsc=1 /etc/sysctl.conf kern.timecounter.hardware=TSC-low Andy further explains: "The loader.conf changes instruct the kernel to not try to do calibration of the TSC, since this calibration could give bad results due to the virtualization, and to ignore the fact that the "invariant TSC" feature is not advertised by the CPU and just assume the CPU has this feature. The sysctl.conf change instructs the kernel to use the TSC-low timecounter which was made available by the loader.conf changes." For reference, here's a link to the posting: https://groups.google.com/forum/#!msg/gce-discussion/ NKhl1QOVucQ/EDyLd_FxCAAJ Maybe these can make it back into the community cloud image. -- -bmw _______________________________________________ freebsd-cloud@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-cloud To unsubscribe, send any mail to "freebsd-cloud-unsubscribe@freebsd.org" From owner-freebsd-cloud@freebsd.org Thu Jan 19 02:26:21 2017 Return-Path: Delivered-To: freebsd-cloud@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C13ECB7425 for ; Thu, 19 Jan 2017 02:26:21 +0000 (UTC) (envelope-from dg@syrec.org) Received: from mail-vk0-x22c.google.com (mail-vk0-x22c.google.com [IPv6:2607:f8b0:400c:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7B4714E2 for ; Thu, 19 Jan 2017 02:26:20 +0000 (UTC) (envelope-from dg@syrec.org) Received: by mail-vk0-x22c.google.com with SMTP id x75so20862335vke.2 for ; Wed, 18 Jan 2017 18:26:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=syrec.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ybWpb6TjmPCBTis+3ly2fjOX4X6Kl/8aS1CwkFi11ew=; b=hugSrnTjBHY8/Sz2U7mjeRxyib7NMw/cPidhL2uF4dZnF/LRe2+OYbBxd0Uhi6UZIe UMtiiUClz7DFmll04jDyx7u52A5k4sHkf8lel6oQWwL0qZ9R5wPIDnuuKMgMdb96ICNJ 3NZkNV0lVKhWudpwNNhwwLS5LjX/o7khJPbS2I6WLWU/0t1/fDWxyDUBGK1715XrePjq ehtQp/nZjy1H3bjhg/yOWV5KuCJzDjTeCBdxz/VDhleMyupWAeeXOQkO/WmBEpt+uQy6 GuF7s6UHYa/Ey1NSaYYOWFGu6sYDSz1lU8stVWQnATr7jGV0jrovif+91OZ0GxxMTgty Yqhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ybWpb6TjmPCBTis+3ly2fjOX4X6Kl/8aS1CwkFi11ew=; b=dFDUxklOdN1K2/zX7GxBxlW9yzruC2P/XJ6oCzbG601gJNN4IHjDImzpiOT6J/BAAQ dW/dZwmIAD19rcZ6964PPmJdsy5HG87G6PwzeYYtFlP9HHC4ZeZeM0gOuza6XsMxvpd0 BFPlS0JttNS8oZ+WdJj7ihX7flghLuPSyIG7LlhRk2vGNMr4JiTCyMJmjVW37y3SlJIE QQ26OiDYpmZoYsvj7Sr1mzsJwqu73w0YaY9mu4mI7UdIDSgsHidpXU5Au1esgnbrXPo9 ketxPQMipVneDN60k4fj4JmTPeSuAvT6lfxYEFmKITVDI4T4YTrKD7FN7GNW/V4VCJPJ Uz4w== X-Gm-Message-State: AIkVDXL+GE37nbxiskcaa9SPICm8D5mtUkCAqH7oQVpeLMJHH3wDIXpbpQRC4y/0JIrUfCqedrurih59hRpSHt1p X-Received: by 10.31.186.131 with SMTP id k125mr3268151vkf.147.1484792779855; Wed, 18 Jan 2017 18:26:19 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.69.133 with HTTP; Wed, 18 Jan 2017 18:26:19 -0800 (PST) X-Originating-IP: [186.43.234.8] In-Reply-To: References: From: Dmitri Goutnik Date: Wed, 18 Jan 2017 21:26:19 -0500 Message-ID: Subject: Re: GCE: significant clock drift - the solution To: Bruce Walker Cc: freebsd-cloud@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-cloud@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "FreeBSD on cloud platforms \(EC2, GCE, Azure, etc.\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2017 02:26:21 -0000 Hi Bruce, Thanks for posting this, setting machdep.disable_tsc_calibration=1 indeed makes TSC-low available and fixes the clock drift. The confusing thing is that timecounter choices vary with GCE hardware and the only common choice seems to be low "quality" i8254. On Wed, Jan 18, 2017 at 8:10 PM, Bruce Walker wrote: > Hi gang, first message. I am developing on Google Cloud Engine, I'm using > the FreeBSD community image, and so far it's been pretty painless. Thank > you! > > But I noticed that the system clock on one of my two instances was drifting > fast over time, and I mean really fast. I estimate about 1 second ahead for > every 20-30 seconds of elapsed time. > > So I would stop and restart ntpd and that would reset the time. Then the > creep again ... > > Long story short: I searched the Google gce-discussion group and found > another FreeBSD user with the same issue, and a solution was provided by > one Andy Carrel. In a nutshell two system boot files need tweaks: > > /boot/loader.conf > machdep.disable_tsc_calibration=1 > kern.timecounter.invariant_tsc=1 > > /etc/sysctl.conf > kern.timecounter.hardware=TSC-low > > Andy further explains: "The loader.conf changes instruct the kernel to not > try to do calibration of the TSC, since this calibration could give bad > results due to the virtualization, and to ignore the fact that the > "invariant TSC" feature is not advertised by the CPU and just assume the > CPU has this feature. > > The sysctl.conf change instructs the kernel to use the TSC-low timecounter > which was made available by the loader.conf changes." > > For reference, here's a link to the posting: > https://groups.google.com/forum/#!msg/gce-discussion/ > NKhl1QOVucQ/EDyLd_FxCAAJ > > > Maybe these can make it back into the community cloud image. > > -- > -bmw > _______________________________________________ > freebsd-cloud@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-cloud > To unsubscribe, send any mail to "freebsd-cloud-unsubscribe@freebsd.org" > From owner-freebsd-cloud@freebsd.org Thu Jan 19 04:04:56 2017 Return-Path: Delivered-To: freebsd-cloud@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBD71CB7BC8 for ; Thu, 19 Jan 2017 04:04:56 +0000 (UTC) (envelope-from bilbo@hobbiton.org) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9108D1A08 for ; Thu, 19 Jan 2017 04:04:56 +0000 (UTC) (envelope-from bilbo@hobbiton.org) Received: by mail-wm0-x22b.google.com with SMTP id r144so57618441wme.1 for ; Wed, 18 Jan 2017 20:04:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hobbiton-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ChgHc86Yymy8MVTJJpTM4vk1NTg7RGc9iNoTMlC7GIk=; b=PCojr78piW5l+zH202hxeAeF8SqNXA0rxBSCS4ab4fZ0FTqi1Rvt2eBzI1OWeTNPsx 6WHvXaaOP2l1KlZ5AM+aFYNcoN8FYlEliNuNJLtqOUr3uoYb3spvFHTZRVfXMck+N1hW x5ERzVeezblf36FkngNTbIUD5G8fN+jT1VX36ApIyehM1e9XGAytSo21zbun7M9gZDTb Z5Sk9wtj6wKFJZ3GlkP1+9n8rxhp50ozI7dFQFlEC22cuYRzsNFbt7O+1R1OcR3+dBC/ zoSO33VDj4aIfjGjKmtIIV3m7jdD+koZxBx4iEeoUEByFu59tME9O9ETXH9IMwcJIu5S yI2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ChgHc86Yymy8MVTJJpTM4vk1NTg7RGc9iNoTMlC7GIk=; b=H99f/x/HO2eTapO6wmaJNbT3IgvIXj3xKM7mwGjLizGJ8xAYc1OgWV3qssqUyXOSuE p65Yh8dx9zkTj1sBUb6m4yZROTXzqgNiER13PHGzWIElhwTsd5VEMvfwolUEDSYAKubO omBOXqYPQ+PqgJkmFmb+BXX3HZ4JB7BaEYQ9XYSt7MwNaM7imZ3bue+PrD+NErbJKTkn l+wreQeSAqhMJbFAJKLvVROV2mdoCaAemmZFo6gzlzuUgC1cDSOE8DZVouz8DaxyyMIB kbBINXDDz3QCPH9JyeUMvCUxkB20wFyFIdSMc3rDvhObq+deiD8lzoa6yT4mEjtscHBo HHSw== X-Gm-Message-State: AIkVDXKQAy+iPPc0KBpIdLDSRgHTXEZ6hUi+kUZj4F5GyAPMw1BfMWXdEjq4oNOeWao/3dVO1i9ju+5Uzokbyw== X-Received: by 10.28.56.133 with SMTP id f127mr134003wma.126.1484798694301; Wed, 18 Jan 2017 20:04:54 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.28.68 with HTTP; Wed, 18 Jan 2017 20:04:53 -0800 (PST) X-Originating-IP: [208.72.151.19] Received: by 10.28.28.68 with HTTP; Wed, 18 Jan 2017 20:04:53 -0800 (PST) In-Reply-To: References: From: Leif Pedersen Date: Wed, 18 Jan 2017 22:04:53 -0600 Message-ID: Subject: Re: GCE: significant clock drift - the solution To: Dmitri Goutnik Cc: freebsd-cloud@freebsd.org, Bruce Walker Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-cloud@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "FreeBSD on cloud platforms \(EC2, GCE, Azure, etc.\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2017 04:04:57 -0000 I wanna say it was i8254 that I had the weird trouble with, but I can't remember for sure. It's my experience as well that much of this seems to vary over time and with different VMs. -Leif On Jan 18, 2017 8:26 PM, "Dmitri Goutnik" wrote: Hi Bruce, Thanks for posting this, setting machdep.disable_tsc_calibration=1 indeed makes TSC-low available and fixes the clock drift. The confusing thing is that timecounter choices vary with GCE hardware and the only common choice seems to be low "quality" i8254. On Wed, Jan 18, 2017 at 8:10 PM, Bruce Walker wrote: > Hi gang, first message. I am developing on Google Cloud Engine, I'm using > the FreeBSD community image, and so far it's been pretty painless. Thank > you! > > But I noticed that the system clock on one of my two instances was drifting > fast over time, and I mean really fast. I estimate about 1 second ahead for > every 20-30 seconds of elapsed time. > > So I would stop and restart ntpd and that would reset the time. Then the > creep again ... > > Long story short: I searched the Google gce-discussion group and found > another FreeBSD user with the same issue, and a solution was provided by > one Andy Carrel. In a nutshell two system boot files need tweaks: > > /boot/loader.conf > machdep.disable_tsc_calibration=1 > kern.timecounter.invariant_tsc=1 > > /etc/sysctl.conf > kern.timecounter.hardware=TSC-low > > Andy further explains: "The loader.conf changes instruct the kernel to not > try to do calibration of the TSC, since this calibration could give bad > results due to the virtualization, and to ignore the fact that the > "invariant TSC" feature is not advertised by the CPU and just assume the > CPU has this feature. > > The sysctl.conf change instructs the kernel to use the TSC-low timecounter > which was made available by the loader.conf changes." > > For reference, here's a link to the posting: > https://groups.google.com/forum/#!msg/gce-discussion/ > NKhl1QOVucQ/EDyLd_FxCAAJ > > > Maybe these can make it back into the community cloud image. > > -- > -bmw > _______________________________________________ > freebsd-cloud@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-cloud > To unsubscribe, send any mail to "freebsd-cloud-unsubscribe@freebsd.org" > _______________________________________________ freebsd-cloud@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-cloud To unsubscribe, send any mail to "freebsd-cloud-unsubscribe@freebsd.org"