Skip site navigation (1) Skip section navigation (2)

Re: gettimeofday() goes backwards on FreeBSD 4.9

From: Kurt Roeckx <Q(at)ping(dot)be>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>,Darcy Buskermolen <darcy(at)wavefire(dot)com>,"Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>,pgsql-hackers(at)postgresql(dot)org
Subject: Re: gettimeofday() goes backwards on FreeBSD 4.9
Date: 2003-11-29 13:14:43
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Fri, Nov 28, 2003 at 08:22:30PM -0500, Tom Lane wrote:
> One variable I didn't think to ask about is whether you are running
> NTP.  In my experience an ntp daemon that has achieved lock will never
> step the clock back by even 1 usec (it's supposed to use much more
> subtle methods than that to manage the clock ;-)) but maybe under
> unstable conditions such things could happen.  The machines I have
> tested here all run NTP.

ntpd will slew the clock in case the difference is small enough.
Which means it will tell the kernel to slow down time a little.

In case the offset is too large (0.128 seconds) it will tell the
kernel to step the clock.

ntpd also has an option to "always slew".  But it's broken on
atleast Linux 2.4.

Note that the kernel uses values from different places to
calculate what the current time is, and they're not all running
on the same frequency.  I wouldn't worry about a 1 us step back.


In response to

pgsql-hackers by date

Next:From: Jason TesserDate: 2003-11-29 16:24:53
Subject: Re: Triggers, Stored Procedures, PHP. was: Re: PostgreSQL Advocacy, Thoughts and Comments
Previous:From: Gavin SherryDate: 2003-11-29 12:09:41
Subject: Re: gettimeofday() goes backwards on FreeBSD 4.9

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group