5

In a default Ubuntu 19.04 - how often is computer time synchronized with time servers?

  • Once every hour?
  • Once every day?
  • Something else entirely?
Fabby
  • 34,259
OZ1SEJ
  • 1,235
  • 3
  • 19
  • 31

1 Answers1

7

The configuration for time synchronization is located in the file /etc/systemd/timesyncd.conf.

The polling defaults are set as follows:

PollIntervalMinSec=32
PollIntervalMaxSec=2048

The systemd-timesyncd.service service will poll the NTP servers(the default is the ntp.ubuntu.com server pool) every 32 seconds. If the client is out of sync (by how much, depends upon how drift variance is accounted for in the defaults), it will attempt to sync with the server.

If it is not out of sync, the polling cycle will continue. Should the servers become unreachable, the polling cycle will continue, and most likely, follow a normal NTP exponential backoff algorithm until the Max Poll Interval of 2048 seconds is reached.

Additional details:

The time server is synchronized using the systemd-timesyncd.service.

one can check the status of the service by using the command systemctl status systemd-timesyncd.service

The output of the command should be something similar to the following output:

● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor prese
   Active: active (running) since Thu 2019-07-04 18:29:39 PDT; 2 days ago
     Docs: man:systemd-timesyncd.service(8)
 Main PID: 3821 (systemd-timesyn)
   Status: "Synchronized to time server 91.189.89.199:123 (ntp.ubuntu.com)."
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/systemd-timesyncd.service
           └─3821 /lib/systemd/systemd-timesyncd

Jul 04 18:29:39 wintermute systemd[1]: Starting Network Time Synchronization...

As indicated in the documentation, more information can be found from the command man systemd-timesyncd.service.

Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83
  • Thank you for this thorough answer. Now, since installing 19.04, I haven't changed anything, and the two lines with PollInterval are commented out. Does that mean that my computer is never synchonizing? The output of the systemctl status-command suggests that my computer hasn't synchronzed since yesterday. Should I just remove the comment signs in the file? – OZ1SEJ Aug 10 '19 at 08:22
  • Aside, why does it need to sync every 32s? – pbhj Dec 28 '21 at 20:37