It’s time to leave the leap second in the past
Leap seconds do more harm than good for modern computing, and Meta backs an industry push to freeze them at the current 27. Inserted seconds produce odd timestamps like 23:59:60, and a never-tested negative leap second could break timers and schedulers. Smearing is not standardized: Meta applies quadratic smearing over 17 hours from 00:00:00 UTC across hundreds of Stratum 2 NTP servers to keep steps small enough that clients don't eject servers from quorum. Further risks include inconsistent leap indicators across GNSS constellations, stale leap files, NTP restarts mid-smear, and code that assumes time never goes backward, as in the Reddit 2012 and Cloudflare 2017 outages.
Related posts
- How Precision Time Protocol handles leap seconds
Meta Engineering mediumAdeptMeta handles leap seconds for its nanosecond-precision PTP service by self-smearing inside the fbclock library, which shifts its returned Window of Uncertainty {earliest_ns, latest_ns} by 1 ns every 62.5 µs. The approach is stateless and reproducible, since the start time comes from tzdata, so a rebooted server can recompute its position. The service keeps TAI internally and returns UTC through the API. The costs are that linear PTP smearing and quadratic NTP smearing can disagree by over 100 µs, hosts still drift apart during the smear, and precisely scheduled jobs end up nearly 1 ms off after 60 seconds. Meta therefore recommends that clients use TAI where possible and supports freezing new leap seconds after 2035.
- PTP: Timing accuracy and precision for the future of computing
Meta Engineering easyNoviceMeta is rolling out Precision Time Protocol (PTP) across its data centers to replace NTP, moving clock synchronization precision from milliseconds to nanoseconds. Accurate offset measurement depends on network latency being consistent and symmetric, so PTP uses hardware timestamping to improve consistency and transparent clocks to improve symmetry. Meta removed boundary clocks so every machine syncs directly with the Server Clock. Because off-the-shelf gear could not handle PTP at its scale, Meta built its own Time Appliance (a GNSS receiver plus a miniaturized atomic clock) and a PCIe Time Card, and has open-sourced the hardware, client software and transparent clock through the Open Compute Project.
- How Precision Time Protocol is being deployed at Meta
Meta Engineering hardMasterMeta replaced NTP with Precision Time Protocol across its data centers to get nanosecond-level clock sync. Its main motivating use is commit-wait reads that bound clock uncertainty and avoid quorum reads, which ran roughly 100x better on PTP than on NTP in Meta's experiments. The design has three parts. The PTP rack has GNSS-over-fiber antennas and OCP Time Cards disciplined by oscillatord, with NIC clocks aligned via ts2phc and PPS to within ±50ns. The network uses unicast PTP with transparent clocks instead of boundary clocks. Clients are served by ptp4u, an open-source Go PTP server handling over 1 million clients per appliance, with c4u generating dynamic clock class and accuracy and Calnex Sentinel independently monitoring the setup.
- Simple Precision Time Protocol at Meta
Meta Engineering hardMasterSimple Precision Time Protocol (SPTP) replaces the subscription-based unicast PTPv2 exchange with a stateless, client-driven three-packet exchange: a delay request (flagged with PTP profile Specific 1), a sync carrying T4, and a followup/announce carrying T1 and CF1. Standard two-step PTP formulas then give path delay and offset. Because the client drives the exchange, it can poll several servers at once and combine them into a clock ensemble. That ensemble rejects outliers using Chauvenet's criterion over 400 samples and weights the remaining clocks by inverse variance. At Meta scale SPTP matches ptp4l precision while cutting CPU by over 40%, memory by 70% and network traffic by 50%, at the cost of losing subscription signaling and authentication.
- NTS: Authenticated Time at Meta
Meta Engineering hardMasterMeta's public time service now supports NTS (RFC 8915) at nts.meta.com, authenticating NTP responses so clients can detect forged time, a growing concern as TLS certificate lifetimes shrink toward 47 days and renewals become unattended. Key exchange runs over TLS 1.3 and hands clients off to separate NTP responders. Those servers hold no per-client state: the cookie-sealing key is derived with HKDF-SHA256 from a shared master secret and the Unix epoch day number, so no key ring is replicated and any responder can open any cookie. NTS still cannot stop delay attacks, bootstrapping circularity, wrong-but-authenticated servers, or non-monotonic wall clocks, and Meta urges Android and iOS to add NTS to their stock time clients.