1 |
On Fri, Jul 26, 2019 at 11:32 AM YUE Daian <sheepduke@×××××.com> wrote: |
2 |
> |
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 |
> |
17 |
> By the way does "rc_parallel" really makes a difference? |
18 |
> I tried it once before but did not really see much difference. |
19 |
|
20 |
I haven't used OpenRC in ages, but I'm guessing that NTP is set as a |
21 |
dependency somewhere in the chain. It does make sense - lots of |
22 |
services do not like abrupt time changes so generic dependencies will |
23 |
probably assume that you want to set your clocks before starting |
24 |
anything. |
25 |
|
26 |
I'm not sure how ntpdate implements time changes. I know that ntpd |
27 |
will slew the clock gradually for small corrections, but it is a |
28 |
daemon so it can easily implement something like that. A one-shot |
29 |
correction will probably be instant, and thus will be more of an |
30 |
impact on other services. |
31 |
|
32 |
You can probably adjust the dependencies to suit your tastes, but of |
33 |
course you'll have to keep in mind that time changes for running |
34 |
services might or might not be a problem. If you're fairly confident |
35 |
in your hardware clock accuracy (assuming you even have one) that |
36 |
isn't a big deal. If you're talking about some system that doesn't |
37 |
keep time when powered off/etc then you probably don't want your |
38 |
database server to spin up thinking it is 1980 or whatever its epoch |
39 |
is. |
40 |
|
41 |
I did a quick check of what is being done with systemd and ntpdate is |
42 |
needed before the time-sync target, and that is needed before starting |
43 |
cron or any timer units (obvious requirement), and it is also required |
44 |
before spinning up libvirt guests, which also makes sense so that |
45 |
those initialize with a clean clock, though if they update themselves |
46 |
maybe that isn't a hard requirement. |
47 |
|
48 |
-- |
49 |
Rich |