SOLVED FreeNAS 11.1 System time late about 1min on every 5min

wiking121

Dabbler
Joined
Jan 9, 2018
Messages
11
Hi, I have strange problem with FreeNAS.
System time late about 1min on every 5min, so after 20 minutes work time my system time is 5 min late, etc.....

I checked BIOS clock without starting FreeNAS and after 10 min everything seems to be OK, but after FreeNAS start problem repeats.
Maybe tomorrow I will make a longer test with BIOS.

ntpdate -b 0.pool.ntp.org
works successful, but only for this moment

but after
service ntpd stop
service ntpd start

I've got only: Jan 9 22:30:36 freenas ntpd[19745]: ntpd 4.2.8p10-a (1): Starting
and nothing else.

I have configured 4 ntp servers 0.pool.ntp.org, 1.pool.ntp.org..... with option IBurst

Any ideas what seems to be wrong?
Greetings
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
What's your hardware? Have you tried replacing the battery on your motherboard?
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,175
NTP can't keep a clock in sync if it's running 20% slower, so that's a red herring.
 

wiking121

Dabbler
Joined
Jan 9, 2018
Messages
11
Well,
I replaced battery 2 weeks ago when I observe abnormal situation.
My FreeNAS doesn't work all the time, so I diagnose the problem just at this moment, but I've observed bad symptoms for a few weeks/months.

Today I made some new tests and I run from USB Ubuntu Live 17.10
I turn off the internet connection to prevent ntp synchronization and.... everything works fine, even with internet connection.
During 2 hours tests (with or without internet connection) system time is exactly in time.

Strange....
My system is:
product: CELSIUS R550 FUJITSU SIEMENS:
*-core
description: Motherboard
product: D2569
vendor: Tyan Computer Corporation
physical id: 0
version: S26361-D2569-A10
*-firmware
description: BIOS
vendor: Phoenix Technologies LTD
physical id: 0
version: 1.06.2569
date: 05/26/2009
size: 107KiB
capacity: 960KiB
*-cpu:0
description: CPU
product: Intel(R) Xeon(R) CPU E5430 @ 2.66GHz
vendor: Intel Corp.
physical id: 4
bus info: cpu@0
slot: CPU0
size: 1995MHz
capacity: 3733MHz
width: 64 bits
clock: 333MHz
8GB memory:
*-bank:0
description: DIMM DDR2 Synchronous 667 MHz (1,5 ns)
product: M395T5663CZ4-CE66
vendor: Samsung
physical id: 0
serial: 0x8A302729
slot: DIMM1
size: 2GiB
width: 64 bits
clock: 667MHz (1.5ns)
 
Last edited:

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
During 2 hours tests (with or without internet connection) system time is exactly in time.
So, does this mean your problem is solved?

If the problem re-occurs when you enable NTP, are you sure you've got your timezone set up correctly?
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
Have you confirmed the timezone is set correctly? If you disable NTP on FreeNAS, does it fix the problem?
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,175
I don't expect this to be a timezone problem. Sounds to me like the default clock is messed up, for some reason. You could try using a different clock, at the cost of some (probably imperceptible) performance loss.
 

wiking121

Dabbler
Joined
Jan 9, 2018
Messages
11
But, why on the same machine ubuntu works well?
I turn off ntpd deamon in /conf/base/etc/rc.conf
Code:
ntpd_enable="NO" 
ntpd_sync_on_start="NO"

and it is still the same.
I also tried to plug off internet cable - still the same.

By the way what is the difference between /conf/base/etc/rc.conf and /etc/rc.conf?

I suppose, that the problem appeared when I upgrade FreeNAS to 11.1.
Is it possible to downgrade FreeNAS, even I updated the pool?
I remember warning alert about upgrading the pool or something like that.
I'm ready to install old instatnce of FreeNAS but what about the data stored on the Volume?
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,175
Maybe Linux defaults to using a higher-precision timer for the clock. Maybe it's a weird bug.
 

wiking121

Dabbler
Joined
Jan 9, 2018
Messages
11
Another tests and...
On FreeNAS 9.3 system clock works OK!
Now I'm going to upgrade to 9.10 and then to 11.
Maybe later I'll made factory reset on my original version 11.1.
I'll post here test results.
Thanks everybody for your response.

Looks that problem is solved by changing clock timer from HPET to ACPI-fast with
kern.timecounter.hardware=XXXXXX
where XXXXX is one of available counters listed by
dmesg | grep Timecounter
and changes saved to /conf/base/etc/sysctl.conf

according to:
https://forums.freenas.org/index.ph...correct-time-frequency-drift-too-large.23900/
https://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/troubleshoot.html#idp56606568
 
Last edited:

wiking121

Dabbler
Joined
Jan 9, 2018
Messages
11
Hello after 2 months...
The problem come back after system upgrade but this time I'm not able to change clock timer from HPET to ACPI-fast because of new /conf/base/etc/sysctl.conf format.
A this moment my sysctl.conf looks:
Code:
]
# Template sysctl.conf file...  Maybe we should put these in the database by def

# By default, FreeBSD flushes things to disk every 30s or so.  In an embedded
# environment, this can leave too much data unflushed.  Reduced these times to
# about as short as you can go.  The syncer flushes these different types
# of blocks after they have been in the queues for X seconds.  It is critical
# that metadelay < dirdelay < filedelay and no fractions are allowed.

kern.metadelay=3
kern.dirdelay=4
kern.filedelay=5
kern.coredump=1
kern.sugid_coredump=1
vfs.timestamp_precision=3
net.link.lagg.lacp.default_strict_mode=0

# Force minimal 4KB ashift for new top level ZFS VDEVs.
vfs.zfs.min_auto_ashift=12


Where should I write correct timer settings now?
 

beltet

Dabbler
Joined
Sep 24, 2013
Messages
26
I now have the same problem as the original TS.
Anyone have a suggestion? I'm on FreeNAS-11.2-U7.

EDIT: I have tried to edit the TimeZone in the UI without success. The UI tells me my Timezone is not available:
snip.png
 

enosh

Cadet
Joined
Jun 28, 2016
Messages
1
I noticed the same issue on my system a few days ago, couldn’t find the right keywords to search until I stumbled into this post. I think it happened when I switched from BIOS to UEFI, though the timeline doesn’t quite line up so I’m not sure. kern.timecounter.hardware was set to TSC-low and changing it to HPET works.

You’ve probably figured this out but for any passers-by you can permanently add this tweak through the web interface at System ➞ Tunables. (Variable kern.timecounter.hardware, type sysctl and value being the time counter you want to use).
 
Top