[Twisted-Python] a question about monotonic clock

Phil Mayers p.mayers at imperial.ac.uk
Mon Oct 29 04:33:48 EDT 2012

On 10/28/2012 10:16 PM, Tristan Seligmann wrote:
> On Mon, Oct 29, 2012 at 12:05 AM, Phil Mayers <p.mayers at imperial.ac.uk> wrote:
>> This depends on how you're running ntpd. If you have "-x" on the command
>> line, yes - ntpd will not step.
>> If not, there are circumstances it will step - clock diffs in excess of
>> 128ms iirc?
> If an offset of 128ms occurs at any time other than initial ntpd
> startup (which will presumably occur at system startup), that means
> you've either experienced a significant period of time without
> connectivity to time servers[1], you have a hardware / kernel issue
> that should be resolved, or some other software on the system is
> messing with the clock. Aside from network issues, the other
> possibilities are all serious issues that should be corrected, not
> tolerated as a normal situation.

Sadly, this is not the case. As has already been pointed out, virtual 
machine clocks can undergo stepping in "normal" oepration. A specfic 
example: if a VMWare installation performs live migration of a host. We 
often see:

ntpd[1793]: time reset +0.263757 s

...when this happens. This can occur several times a day, as we're 
running vCenter-controlled auto-migration - a very common setup. This is 
forward stepping of course, so is relatively harmless (backward is a pain).

>> Who knows what newer implementations like chrony or openntpd do!
> If they're doing something silly, then maybe you shouldn't use them.

I have no reason to suspect they are doing somthing silly. I merely 
point out that there are other implmentations than the common ntpd, and 
that I don't know if they step or not. In fact, a little research 
suggests that chrony has *better* behaviour w.r.t stepping than ntpd:


...which is nice.

I sense a bit of defensiveness to this reply, TBH. Maybe I'm imagniing 
it, but if so that's unncessary. I don't hold a strong position about 
Twisted having a monotonic clock.

When the original ticket was discussed here months ago, I was quite 
alarmed because the symptoms sounded dire. Further discussion clarified 
what the issues were, and I decided they weren't significant (for us).

Maybe "Twisted doesn't need a monotonic clock" is the right reply, but 
it would be wrong to base that on the assumpton that "ntpd doesn't step" 
- that's all I was trying to say.


More information about the Twisted-Python mailing list