Score:0

Time counting in docker faster than in host system

fo flag

I ran into a weird situation when the time counted by the application running in docker is a lot faster that the time elapsed in the host system running docker. And we're not talking about some milliseconds, but straight 7 times faster.

Here's the last line in the log that tracks the application running in docker:

07:03.06969>  Time: 00:58.84

The time on the right (58 seconds) is the time counted by the application running in docker (Blender in this instance) and the time at the start (7 minutes) is the time counted by the script that launched docker and monitored the output of the application running in docker.

The time drift was gradual, we're not talking about a big jump, but the time drifted gradually, as the output lines were being logged.

This was not an isolated incident, it was happening randomly on multiple different servers running the exact same setup (AWS instances). And, of course, some instances behaved absolutely normal, with zero time drift. These are AWS instances where we get the entire server (though still virtualized, not bare metal), so I assume stolen time can be excluded here.

So my question is, what may cause this time drift? And what can I do to prevent it from happening, or at least mitigate the issue?

Thanks!

John Mahowald avatar
cn flag
Edit your question to add, how exactly did these applications get the elapsed time? Look at source code or trace system and library calls if you have to. For a reference at the mess of time-related functions in C, see https://www.catb.org/esr/time-programming/ Beware that CPU time is not going to be wall clock time, there may be many CPUs in a multi-core system.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.