Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] ntp-client slows down the boot process
Date: Fri, 26 Jul 2019 16:38:33
Message-Id: 1684281.5jACNYeINd@localhost
In Reply to: Re: [gentoo-user] ntp-client slows down the boot process by Rich Freeman
1 On Friday, 26 July 2019 16:49:25 BST Rich Freeman wrote:
2 > On Fri, Jul 26, 2019 at 11:32 AM YUE Daian <sheepduke@×××××.com> wrote:
3 > > I switched to a faster NTP server. It still takes some seconds but
4 > > better than before.
5 > >
6 > > Maybe you are right. Having correct system time is more important than
7 > > several seconds...
8 >
9 > You're never going to make NTP fast unless you're using a VERY
10 > low-latency server - like something on your own LAN. That is just the
11 > nature of the protocol - it has to do a round trip, and of course to
12 > do anything it needs the interface up, DNS, and so on, and all of
13 > these will be starting from cold caches. If you have non-local DNS
14 > and non-local NTP then that is multiple round-trips to the internet.
15 >
16 > > By the way does "rc_parallel" really makes a difference?
17 > > I tried it once before but did not really see much difference.
18 >
19 > I haven't used OpenRC in ages, but I'm guessing that NTP is set as a
20 > dependency somewhere in the chain. It does make sense - lots of
21 > services do not like abrupt time changes so generic dependencies will
22 > probably assume that you want to set your clocks before starting
23 > anything.
24 >
25 > I'm not sure how ntpdate implements time changes. I know that ntpd
26 > will slew the clock gradually for small corrections, but it is a
27 > daemon so it can easily implement something like that. A one-shot
28 > correction will probably be instant, and thus will be more of an
29 > impact on other services.
30 >
31 > You can probably adjust the dependencies to suit your tastes, but of
32 > course you'll have to keep in mind that time changes for running
33 > services might or might not be a problem. If you're fairly confident
34 > in your hardware clock accuracy (assuming you even have one) that
35 > isn't a big deal. If you're talking about some system that doesn't
36 > keep time when powered off/etc then you probably don't want your
37 > database server to spin up thinking it is 1980 or whatever its epoch
38 > is.
39 >
40 > I did a quick check of what is being done with systemd and ntpdate is
41 > needed before the time-sync target, and that is needed before starting
42 > cron or any timer units (obvious requirement), and it is also required
43 > before spinning up libvirt guests, which also makes sense so that
44 > those initialize with a clean clock, though if they update themselves
45 > maybe that isn't a hard requirement.
46
47 Just a thought - is the hwclock service in the boot run level and running? I
48 think it will restore the time stored on the hwclock to the system and then
49 gradually update it as the ntp-client starts communicating with various time
50 servers. At least this is how chrony does it.
51
52 --
53 Regards,
54
55 Mick

Attachments

File name MIME type
signature.asc application/pgp-signature