DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 17th June 2008
cajunman4life cajunman4life is offline
Real Name: Aaron Graves
Package Pilot
 
Join Date: May 2008
Location: Coolidge, Arizona
Posts: 203
Thanked 16 Times in 14 Posts
Default Time drift

I run a cron job on all my machines at varying times between midnight and 1 am that updates the system clock via NTP. I've noticed that the drift on my machines is usually between 2-4 seconds, which I guess isn't too bad, but when you stop to think about it, if I wasn't updating via NTP every day, then after a month I would be nearly a minute off.

Not to mention running at securelevel 2+ caps time changes at 1 second.

So, is there some sysctl that can be set to tune the clock ticks?

I did a quick google search that didn't yield much too promising (then again I'm on the brink of passing out from lack of sleep). Any help would greatly be appreciated, as I would like to bump up the securelevel to 3 once my firewall rules are in place and thoroughly tested.

sysctl kern.timecounter:
Code:
kern.timecounter.tick: 1
kern.timecounter.choice: TSC(-100) ACPI-fast(1000) i8254(0) dummy(-1000000)
kern.timecounter.hardware: ACPI-fast
kern.timecounter.nsetclock: 4
kern.timecounter.ngetmicrotime: 4239525
kern.timecounter.ngetnanotime: 1
kern.timecounter.ngetbintime: 0
kern.timecounter.ngetmicrouptime: 1846524
kern.timecounter.ngetnanouptime: 1902
kern.timecounter.ngetbinuptime: 18796
kern.timecounter.nmicrotime: 756286
kern.timecounter.nnanotime: 115
kern.timecounter.nbintime: 756427
kern.timecounter.nmicrouptime: 66335
kern.timecounter.nnanouptime: 3
kern.timecounter.nbinuptime: 950632
kern.timecounter.stepwarnings: 0
kern.timecounter.tc.i8254.mask: 65535
kern.timecounter.tc.i8254.counter: 35499
kern.timecounter.tc.i8254.frequency: 1193182
kern.timecounter.tc.i8254.quality: 0
kern.timecounter.tc.ACPI-fast.mask: 16777215
kern.timecounter.tc.ACPI-fast.counter: 3199901
kern.timecounter.tc.ACPI-fast.frequency: 3579545
kern.timecounter.tc.ACPI-fast.quality: 1000
kern.timecounter.tc.TSC.mask: 4294967295
kern.timecounter.tc.TSC.counter: 1817965752
kern.timecounter.tc.TSC.frequency: 1041000000
kern.timecounter.tc.TSC.quality: -100
kern.timecounter.smp_tsc: 0
dmesg | grep Timecounter
Code:
Timecounter "i8254" frequency 1193182 Hz quality 0
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
Timecounters tick every 1.000 msec
Any further information needed, just ask.

I guess an option could be instead of running the cron job to update the clock once a day, I do it 4 times a day (so the changes should be < 1 second each time). But I'd prefer to fix this little issue.

Also, forgot to mention, don't know if the clock is fast of slow. Here's a sample output:
Code:
17 Jun 00:31:00 ntpdate[66266]: ntpdate 4.2.0-a Tue Jun 10 13:05:26 MST 2008
(1)
17 Jun 00:31:03 ntpdate[66266]: step time server 82.165.177.157 offset
1.870777 sec
Edit: Looking at the dates from the cron mail above, it appears that the clock is running slow (unless if the nptdate command took ~3 seconds to run by itself, but usually if I run it manually it doesn't take anywhere near that long)
__________________
I just saved a bunch of money on my car insurance by fleeing the scene of the accident!

Last edited by cajunman4life; 17th June 2008 at 07:46 AM.
Reply With Quote
  #2   (View Single Post)  
Old 17th June 2008
Weaseal's Avatar
Weaseal Weaseal is offline
Package Pilot
 
Join Date: May 2008
Location: East Coast, US
Posts: 177
Thanked 7 Times in 7 Posts
Default

Please see http://www.freebsd.org/doc/en/books/...twork-ntp.html for the proper configuration of syncing time with ntp. Doing it through cron is not advisable.
__________________
FreeBSD addict since 4.2-RELEASE.
My FreeBSD wiki.
Reply With Quote
  #3   (View Single Post)  
Old 17th June 2008
ithron ithron is offline
New User
 
Join Date: Jun 2008
Posts: 1
Thanked 0 Times in 0 Posts
Default

Might want to check out Clockspeed, as well

ports/sysutils/clockspeed
ports/sysutils/clockspeed-conf
Reply With Quote
  #4   (View Single Post)  
Old 17th June 2008
cajunman4life cajunman4life is offline
Real Name: Aaron Graves
Package Pilot
 
Join Date: May 2008
Location: Coolidge, Arizona
Posts: 203
Thanked 16 Times in 14 Posts
Default

I don't know why but I completely forgot about ntpd

I'll have a look at clockspeed also.
__________________
I just saved a bunch of money on my car insurance by fleeing the scene of the accident!
Reply With Quote
  #5   (View Single Post)  
Old 18th June 2008
cajunman4life cajunman4life is offline
Real Name: Aaron Graves
Package Pilot
 
Join Date: May 2008
Location: Coolidge, Arizona
Posts: 203
Thanked 16 Times in 14 Posts
Default

FYI - ntpd is working beautifully. When checking the time now, it is exactly (and I mean down to the second) the same time that my MacBook is... which is set to auto-update from time.apple.com.

So clearly it worked Thanks.
__________________
I just saved a bunch of money on my car insurance by fleeing the scene of the accident!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Weird time issues schrodinger OpenBSD General 7 26th October 2009 03:20 PM
Time for a New Laptop harold FreeBSD General 4 5th October 2009 05:56 AM
NFS time outs trilog General software and network 1 5th May 2009 07:21 AM
Set time in Jail tanked FreeBSD General 5 22nd August 2008 01:51 PM
Real Time OS corey_james Off-Topic 2 11th July 2008 02:56 PM


All times are GMT. The time now is 05:00 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick