Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 09 Jun 2008 11:34:10 -0400
From:      Jeff Dickens <jeff@m2.seamanpaper.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: vmware timekeeping
Message-ID:  <484D4D72.7070108@m2.seamanpaper.com>
In-Reply-To: <BAY126-W1671FB121979728C34AA29CAB70@phx.gbl>
References:  <48499CCD.2010708@m2.seamanpaper.com>	<200806062048.m56Kmhtl071591@mail.icsmx.com> <BAY126-W1671FB121979728C34AA29CAB70@phx.gbl>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------090805020304010900090307
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit



Sean Cavanaugh wrote:
> ----------------------------------------
>   
>> Date: Fri, 6 Jun 2008 15:48:46 -0500
>> To: freebsd-questions@freebsd.org
>> From: jbiquez@icsmx.com
>> Subject: Re: vmware timekeeping
>>
>> At 03:23 p.m. 06/06/2008, you wrote:
>>     
>>> I'm running FreeBSD 6.3-release as a guest on VMware ESX 3.0.2.  My 
>>> problem is that the clock keeps *gaining* time.  I have the 
>>> "timesync" option turned on in ESX's .vmx file, and I have 
>>> "hint.apic.0.disabled=1" in my FreeBSD guest's /boot/loader.conf.
>>>
>>> I used to have "kern.hz=100" in loader.conf, but that caused the 
>>> guest to gain time even faster.
>>>
>>> Does anyone have a good recipe for decent timekeeping in this config?
>>>
>>> Thanks.
>>> _______________________________________________
>>> freebsd-questions@freebsd.org mailing list
>>> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>>> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
>>>       
>> Hello all.
>>
>> Here is something similar. Running 6.2 stable... but the clock lose 
>> around 6 hours each day
>>
>> JB
>>
>>     
>
>
> The only good way of keeping time pretty set is to set up an NTP sync on the image to go off at decently constant rate (once every 3 hours or so). the vmware-tools will not synchronize the system clock.
>   
The tools do attempt to improve timekeeping if you put

    tools.syncTime = "TRUE"

in the guest's .vmx file.  However, the tools will only move the time 
forward.  It is attempting to compensate for "lost ticks".  Without 
using syncTime the guest's clock can run slow, depending on the host's 
overall load.   With syncTime on, my Linux guest machines stay 
synchronized perfectly.  Well, they're within one second anyway, which 
is fine for my application.  The recipe for this success was to turn on 
syncTime, and use the following linux boot options:

    clock=pit nosmp noapic nolapic


However, I have not been able to achieve the same success with 
FreeBSD.   The clock doesn't lose time, but it gains time, very slowly.  
It's probably load dependent, but it's around 10 seconds a day.  What's 
the FreeBSD equivalent of "clock=pit" ?  Meaning to use the PIT and not 
the APIC.

In general, but also in this application in particular, one does not one 
time to move backwards.  The Dovcot IMAP server immediately exits if it 
detects that time went backwards.

In order to use NTP, you'd probably have to turn off syncTime, which 
probably does a better job anyway except for the gaining time problem.  
I haven't tried actually running ntpd instead of a periodic sync, as 
this is not recommended by VMware's timekeeping white paper: 
http://www.vmware.com/pdf/vmware_timekeeping.pdf.  My last-ditch 
strategy will be to start monkeying with the knobs for syncTime, like these:

    timeTracker.catchupPercentage
    timeTracker.catchupIfBehindByUsec
    timeTracker.giveupIfBehindByUsec

But I'd rather fix it the same way I have with Linux.



> I heard of someone trying to change the clock in BSD to only use the hardware clock as VMWare can reset that but never heard anything beyond that. 
>
> -Sean_______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
>   

--------------090805020304010900090307--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?484D4D72.7070108>