Red Hat Bugzilla – Bug 836803. RHEL6: Potential fix for leapsecond caused futex related load spikes. Last modified: 2016-01-20 03:09:47 EST. Five different ways to handle leap seconds with NTP. Posted by Miroslav Lichvar on June 1, 2015 June 23, 2016. Leap second handling in SUSE Linux products. Leap seconds are a mechanism to adjust for differences between time as kept by atomic clocks and the notion of time. This article was created to advise on what preparations VMware recommends to avoid being impacted by the Leap Second.A leap second is a one-second adjustment th. Five different ways to handle leap seconds with NTP – Red Hat Developer Blog. A leap second is an adjustment that is once in a while applied to the Coordinated Universal Time (UTC) to keep it close to the mean solar time. The concept is similar to that of leap day, but instead of adding a 2. February to keep the calendar synchronized with Earth’s orbit around the Sun, an extra second 2. ![]() June or December to keep the time of the day synchronized with the Earth’s rotation relative to the Sun. The mean solar day is about 2 milliseconds longer than 2. Moon is constantly slowing down the Earth’s rotation. UTC is based on the International Atomic Time (TAI) and it is currently 3. Red Hat Account Number: Account Details; Newsletter and Contact Preferences; User Management; Account Maintenance. We have another leap second coming. Have past bugs with Centos and leap seconds (specifically high CPU spikes) been resolved? TAI. The first leap second was inserted in 1. The next one is scheduled for 3. June 2. 01. 5, when the offset from TAI will increase to 3. Leap seconds are scheduled only about 6 months in advance. There is a possibility that leap seconds will be abolished in the future. A discussion about this topic has been going on for a long time, but so far no agreement has been reached. The current plan is that the International Telecommunication Union (ITU) will decide at the World Radiocommunication Conference in November 2. The trouble with leap seconds on computers is that there is no room for them in the standard Unix time. That is the time which is kept by the CLOCK. It’s defined as number of seconds since 0. UTC on 1 January 1. The system clock cannot have time 2. Ordinary computer clocks are not stable enough to keep time on their own so accurate than an extra second added every year or two would matter, but when a clock is synchronized with NTP servers with millisecond accuracy, the inability of the clock to go through an inserted leap second is a real issue. While technically it wouldn’t be very difficult to modify an NTP implementation to keep the system time in a representation which does include leap seconds and use for instance special time zones (e. ![]() Also, the applications would need to use a different representation to store future dates with a given time of day as leap seconds are scheduled only few months ahead. Otherwise with every inserted leap second any future dates after the leap second with a fixed time of the day would have to be shifted by one second ahead. When a leap second is inserted to UTC, the system clock skips that second as it can’t be represented and is suddenly ahead of UTC by one second. There are several ways how the clock can be corrected. The most common approach is to simply step the clock back by one second when the clock gets to 0. UTC. This is implemented in the Linux kernel and it is enabled by default when the clock is synchronized with NTP servers by the ntpd or chronyd daemon from the reference or chrony NTP implementations respectively. The backward jump doesn’t happen exactly at 0. The clock repeats most of the 2. The outcome is that the clock is off by one second for one second. The following graph shows how will the offset to TAI of a system clock keeping time in UTC and synchronized by ntpd or chronyd in default configuration change on 3. June 2. 01. 5. For some applications the backward jump can be a major problem. In some cases it’s a bug that could be fixed by using the CLOCK. But when real time is really needed, there are problems that are difficult to fix, e. It’s implemented as a clock running at a fixed integral offset to CLOCK. It was introduced in the Linux kernel version 3. RHEL7. Please note that the offset from CLOCK. The clock is slowed down until UTC catches up with it. The time stays monotonic, but it is inaccurate for a longer time than with the step approach and it’s also running slower. This may be or may be not acceptable depending on the application. Another issue is that the CLOCK. With ntpd versions before 4. The one- second error gained after the leap second will be measured and corrected later by slewing in normal operation using NTP servers which already corrected their local clocks. This graph shows the offset to TAI of a system clock synchronized by ntpd with the - x option and the default maximum polling interval of 1. There is a significant overshoot and it takes about 2 days for the clock to get back to millisecond accuracy. This can be improved with a shorter polling interval. However, the time of the start of the correction and its course is random to some extent, so clocks on multiple systems using ntpd - x will drift apart from each other and will not get close together again until the correction is near its end. Again, that may or may not be acceptable. Options with chronyd. When the system clock is synchronized by chronyd, which is the default NTP client since Fedora 1. RHEL7, the leap second correction is by default made by the kernel. That is the same as with ntpd. With version 2. 0, which is now included in Fedora 2. It can be set to four different values: system selects the default mode using the kernel stepstep selects a mode where the clock is stepped by chronyd instead of the kernel, this is similar to ntpd (version 4. NTP operation, similarly to ntpd with the - x optionslew selects a slewing mode. This graph shows a system clock’s offset to TAI when synchronized by chronyd with the leapsecmode option set to slew. The correction starts as close to 0. UTC as the kernel can schedule the chronyd process to run and update the frequency of the clock. It takes 1. 2 seconds to complete. The correction is quick, but the large frequency error of 8. That may or may be not acceptable. The slewing rate can be configured with the maxslewrate option. When the rate is set to 1. The correction now takes 1. Clocks on multiple systems using the same maxslewrate stay very close together the whole time. This might be a recommended configuration when the system or step modes are not acceptable. Please note that unlike ntpd with the - x option, chronyd configured with leapsecmode slew can still be used as a good NTP server. The local clock is corrected by slew, but the time served to NTP clients is stepped on leap second. The slow local correction is not visible to the clients. Leap smear with chronyd. A completely different approach to correct clocks for leap second on multiple systems in a controlled manner is to suppress the information about upcoming leap second on the NTP server and slowly slew the served NTP time instead. The clients don’t know a leap second will be inserted, they don’t make any corrections for it themselves and simply follow the server time which eventually brings them back to UTC. This idea was described by Google in 2. On the client side no special configuration is needed. But care must be taken to ensure the clients use for synchronization only NTP servers that smear leap second in the exactly same way and not normal servers which announce leap second and also make the backward step when leap second is inserted. If a client used one smearing server and two or more normal servers, the smearing server would be outvoted by the others and marked as a falseticker, effectively disabling the leap smear. If it used one smearing server and one normal server, it wouldn’t know which server to trust and would fail to synchronize until the servers agree with each other again. As for the server side, chronyd since version 2. It’s implemented as a special case of a time smoothing feature, which was designed for servers that are most of the time isolated from Internet without any reference clocks and serve time in a network where clients are not required to keep very accurate time, but their clocks must stay close together. Normally, when an NTP server resynchronizes its clock after being offline for a long time, there is an abrupt change in the served time which the clients follow later at random times and it takes a while until their clocks are close to each other again. Leap second is handled as a one- second offset accumulated at 0. UTC that is smoothed out. Since the smoothing process smooths out also frequency adjustments of the local clock, the leap smear is not exactly the same between different NTP servers. It’s not recommended to configure an NTP client with more than one time smoothing server. A new option will likely be added to chronyd to smooth out only the leap second and nothing else to make the leap smear constant and allow the clients to use multiple servers safely. This feature needs to be used carefully, because the server is intentionally not serving its best estimate of the true time. It would probably be a bad idea to do this on a public NTP server, similarly to the - x option with ntpd. The slewing of the served time is not linear. The frequency has to be adjusted slowly without any steps in order to allow the clients to track it easily. In the Google implementation it was implemented with a cosine function, but it seems this year a simple linear smear will be used on their servers instead. In chronyd it’s implemented with a quadratic spline function with two or three pieces. An advantage over the cosine function is that the rate of the frequency change (2nd derivative of the spline function) at the beginning of the smear, assuming the same interval over which it’s performed, is about 2. With a cubic spline the rate of the frequency change would start at zero, which could be useful to give the clients enough time to shorten their polling intervals at the beginning of the smear and then track faster changes in the frequency later more easily. Another difference to the Google implementation is that chronyd starts the smear when the leap second (or any other offset) is actually inserted, the time is not precompensated beforehand. The leap smear can be enabled by adding the following directives to /etc/chrony. The first directive tells chronyd to correct the local system clock by slewing on leap second. This is necessary to disable the clock step which would reset the smoothing process. The second directive limits the slewing rate of the local clock to 1. The third directive enables the server time smoothing.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
October 2017
Categories |