Set the time reference on your EC2 instance to use the local Amazon Time Sync Service
The Amazon Time Sync Service provides several methods for your Amazon EC2 instance to synchronize to a local time source.
First, any Amazon EC2 instance can reach a local time source over the Network Time Protocol (NTP).
In addition, the enhanced Amazon Time Sync Service offers higher-accuracy local time sources to
supported Amazon EC2 instances.
Launch your supported instance in a placement group with the precision-time strategy to reach a
higher-accuracy NTP source. Finally, Linux instances launched in a precision time placement group have
access to a PTP Hardware Clock (PHC) device and the ability to retrieve hardware packet timestamps.
Any Amazon EC2 instance has access to the local NTP source. You can reach the NTP source over a link-local IP address, which restricts this traffic to within your VPC without the need for specific VPC configuration changes. Your AMI might already have configured your clock synchronization daemon to use the local NTP source by default. This NTP source is available over the following IP addresses:
-
IPv4:
169.254.169.123 -
IPv6:
fd00:ec2::123(Only accessible on Nitro-based instances.)
Supported Amazon EC2 instances
have access to the enhanced Amazon Time Sync Service. To access the enhanced Amazon Time Sync Service, launch a supported
instance in a placement group with the precision-time strategy. You do not
need to configure your instance to benefit from this improvement if you use the NTP
link-local IP addresses. Any operating system can use this enhancement. You can verify
that you benefit from the enhanced NTP source by using your NTP client of choice.
Linux-based AMIs, running on supported instance families, have the additional option to source time from a PHC device. The ENA driver makes this device available. Both enhanced NTP source and PHC device use the same highly accurate time source. Access to the PHC time source is optimized, leading to a more accurate synchronization of your Amazon EC2 instance.
Considerations
The NTP time source offers a leap smearing view of the UTC timescale, while the PHC does not smear time. For more information, see Leap seconds.
Only Linux instances have access to the local PTP hardware clock. Windows instances must use NTP to access the enhanced Amazon Time Sync Service.
There is a 1024 packet per second (PPS) limit to services that use link-local addresses. This limit includes the aggregate of Route 53 Resolver DNS Queries, Instance Metadata Service (IMDS) requests, Amazon Time Sync Service Network Time Protocol (NTP) requests, and Windows Licensing Service (for Microsoft Windows based instances)
requests.
Contents
Access the IPv4 endpoint of the Amazon Time Sync Service
Your AMI might already have configured the Amazon Time Sync Service by default. Otherwise, use the following procedures to configure your instance to use the local Amazon Time Sync Service through the IPv4 endpoint.
For help troubleshooting issues, see Troubleshoot NTP synchronization issues on Linux instances
Access the IPv6 endpoint of the Amazon Time Sync Service
This section explains how the steps described in Access the IPv4 endpoint of the Amazon Time Sync Service differ if you are configuring your instance to use the local Amazon Time Sync Service through the IPv6 endpoint. It doesn't explain the entire Amazon Time Sync Service configuration process.
The IPv6 endpoint is only accessible on Nitro-based instances.
We don't recommend using both the IPv4 and IPv6 endpoint entries together. The IPv4 and IPv6 NTP packets come from the same local server for your instance. Configuring both IPv4 and IPv6 endpoints is unnecessary and will not improve the accuracy of the time on your instance.
Access the enhanced Amazon Time Sync Service
The enhanced Amazon Time Sync Service offers higher accuracy local time sources to supported Amazon EC2 instances. Instances launched in a placement group with a precision-time strategy can access these local sources.
We recommend precision time placement groups for applications that require more accurate time from
either the link-local NTP source, or a PTP Hardware Clock (PHC) device on a Linux instance. When you launch
instances into a precision time placement group, AWS places them on supported hardware with direct
access to high-precision time sources in AWS infrastructure.
Key benefits
-
Improved NTP source by default — Your instance has immediate access to an enhanced local NTP time source, if you use the NTP link-local IP addresses as described in the preceding section.
-
Microsecond-accurate clock synchronization — Configure your Amazon EC2 Linux instance to use a PTP Hardware Clock device and achieve microsecond-accurate clock synchronization.
-
Simplified deployment — Single placement strategy ensures all instances have precision time capabilities.
-
Hardware packet timestamping — Access low-level packet timestamps for network measurements.
-
No additional cost — Precision time placement groups are available at no extra charge.
Rules and limitations
-
Precision time placement groups are available in all AWS Commercial Regions.
-
Precision time placement groups support the following Gen7 and later Amazon EC2 instance families:
-
General purpose: M7a, M7g, M7g-flex, M7gd, M7i, M7i-flex, M8a, M8g, M8g-flex
-
Compute optimized: C7a, C7gd, C7i, C7i-flex, C8g, C8g-flex, C8gd
-
Memory optimized: R7a, R7g, R7i, R7id, R8g, X8adez, X8adz-3tb, X8adz-6tb, X8adzs, X8aedez, X8aedz-3tb, X8aedz-6tb, X8aez, X8az, X8g, X8ge
-
Storage optimized: I8g, I8ge
-
-
If you start or launch an instance in a precision time placement group and there is insufficient hardware to give access to the enhanced Amazon Time Sync Service, the request fails.
-
If you stop an instance in a precision time placement group and then start it again, it still runs in the placement group. However, the start might fail if there is insufficient hardware to give access to the enhanced Amazon Time Sync Service.
-
Amazon EC2 continuously adds hardware that supports the enhanced Amazon Time Sync Service. If your request fails due to insufficient capacity, try again later or try a different Availability Zone. For more information, see Troubleshoot Amazon EC2 instance launch issues.
-
Rules and limitations of placement groups apply. For more information, see Placement groups for your Amazon EC2 instances
Create a precision time placement group
You can create a precision time placement group using the AWS CLI, AWS
Management Console, or AWS SDKs, by specifying the
precision-time strategy.
Using AWS CLI
Run the following command:
aws ec2 create-placement-group \ --group-namemy-precision-time-pg\ --strategy precision-time
The command returns a placement group ARN that you use when creating capacity reservations, and a group name or group ID that you use when launching instances and linking placement groups.
Launch an instance
After you create a precision time placement group, specify it when launching instances to access the enhanced Amazon Time Sync Service:
aws ec2 run-instances \ --image-idami-0abcdef1234567890\ --instance-typer7g.2xlarge\ --placement GroupId=pg-0aaa1111111111111
Verify access to the enhanced Amazon Time Sync Service
After you launch your instance in a precision time placement group, you benefit from an enhanced NTP time source.
For example, if you use the chronyd daemon on your instance, you can verify that the NTP time source is now referred to as a Stratum 1 and has improved clock accuracy metrics:
[ec2-user ~]$chronyc sources
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* 169.254.169.123 1 4 377 3 +3477ns[+4689ns] +/- 91us
Verify the time synchronization metrics that are reported by
chrony.
[ec2-user ~]$chronyc tracking
Reference ID : A9FEA97B (169.254.169.123)
Stratum : 2
Ref time (UTC) : Wed May 06 01:33:43 2026
System time : 0.000000276 seconds fast of NTP time
Last offset : +0.000000331 seconds
RMS offset : 0.000001929 seconds
Frequency : 2.870 ppm fast
Residual freq : +0.000 ppm
Skew : 0.031 ppm
Root delay : 0.000107584 seconds
Root dispersion : 0.000036476 seconds
Update interval : 16.2 seconds
Leap status : Normal
Access the PTP Hardware Clock (PHC)
The PTP Hardware Clock (PHC) is part of the AWS Nitro System. It is directly accessible on supported bare metal and virtualized Amazon EC2 instances launched in a precision time placement group. The PHC device is currently accessible on Linux instances only. The following sections describe how to set up and verify the PHC device on your Linux instance.
Requirements
-
ENA driver version 2.10.0 or later installed on a supported operating system.
-
An Amazon EC2 instance running Linux. For more information about supported operating systems, see the driver prerequisites
on GitHub. -
An Amazon EC2 instance launched in a precision time placement group (see Access the enhanced Amazon Time Sync Service).
Note
The enhanced Amazon Time Sync Service and the PHC device remain accessible without a precision time placement group in the following regions and for the specific instance families. For the best experience, we recommend launching Amazon EC2 instances in precision placement groups instead.
-
Legacy access supported AWS Regions: US East (N. Virginia), US East (Ohio), Asia Pacific (Malaysia), Asia Pacific (Thailand), Asia Pacific (Tokyo), and Europe (Stockholm)
-
Legacy access supported Local Zones: US East (New York City)
-
Legacy access supported instance families:
-
General purpose: M7a, M7g, M7i
-
Memory optimized: R7a, R7g, R7i
-
Storage optimized: I8g, I8ge
-
Compile and enable the ENA driver with PHC support
Always review the most recent instructions from the latest Elastic Network Adapter (ENA) driver
version in the ENA driver documentation
Before you begin, ensure your instance meets the Requirements.
To compile and enable the ENA driver with PHC support
-
Install prerequisites.
[ec2-user ~]$sudo yum update[ec2-user ~]$sudo yum install kernel-devel-$(uname -r) git[ec2-user ~]$sudo reboot -
Load the required ptp module.
[ec2-user ~]$sudo modprobe ptp -
Retrieve the latest ENA driver version (version 2.10.0 or later).
[ec2-user ~]$git clone https://github.com/amzn/amzn-drivers.git /tmp/amzn-drivers -
Build the ENA driver
ena.kowith PHC support.[ec2-user ~]$cd /tmp/amzn-drivers/kernel/linux/ena[ec2-user ~]$ENA_PHC_INCLUDE=1 make -
Reload the ENA driver and enable the PHC device.
[ec2-user ~]$sudo rmmod ena && sudo insmod ena.ko phc_enable=1 -
Validate the loaded ENA driver has PHC support.
[ec2-user ~]$modinfo ena | grep -E "phc_enable"parm: phc_enable:Enable PHC. -
Validate the PHC support is enabled with the ENA driver.
[ec2-user ~]$cat /sys/module/ena/parameters/phc_enable1
For instructions to install the driver and activate the phc_enable option upon reboot, see the
ENA driver README
Verify the PTP device configuration
Verify that the ENA PTP hardware clock device shows up on your instance.
[ec2-user ~]$for file in /sys/class/ptp/*; do echo -n "$file: "; cat "$file/clock_name"; done
Expected output
/sys/class/ptp/ptp<index>: ena-ptp-<PCI slot>
Where:
-
is the kernel-registered PTP hardware clock index.index -
is the ENA ethernet controller PCI slot. This is the same slot as shown inPCI slotlspci | grep ENA.
Example output
/sys/class/ptp/ptp0: ena-ptp-05
If ena-ptp-
is not in the output, the ENA driver was not correctly installed.
Review the steps in Compile and enable the ENA driver with PHC support.<PCI slot>
Configure PTP symlink
PTP devices are typically named /dev/ptp0,
/dev/ptp1, and so on, with their index depending on
the hardware initialization order. Creating a symlink ensures that
applications like chrony consistently reference the correct device,
regardless of index changes.
The latest Amazon Linux 2023 AMIs include a udev rule that
creates the /dev/ptp_ena symlink, pointing to the
correct /dev/ptp entry associated with the ENA
host.
First, check if the symlink is present by running the following command.
[ec2-user ~]$ls -l /dev/ptp*
Example output
crw------- 1 root root 245, 0 Jan 31 2025 /dev/ptp0
lrwxrwxrwx 1 root root 4 Jan 31 2025 /dev/ptp_ena -> ptp0
Where:
-
/dev/ptpis the path to the PTP device.<index> -
/dev/ptp_enais the constant symlink, which points to the same PTP device.
If the /dev/ptp_ena symlink is present, skip to
Configure the chronyd daemon to use the PHC device. If it's missing, do the following:
To create the PTP symlink
-
Add the following
udevrule.[ec2-user ~]$echo "SUBSYSTEM==\"ptp\", ATTR{clock_name}==\"ena-ptp-*\", SYMLINK += \"ptp_ena\"" | sudo tee -a /etc/udev/rules.d/53-ec2-network-interfaces.rules -
Reload the
udevrule, either by rebooting the instance, or by running the following command.[ec2-user ~]$sudo udevadm control --reload-rules && sudo udevadm trigger
Configure the chronyd daemon to use the PHC device
The chronyd clock synchronization daemon must be configured to use the PHC device as an additional time source, using the /dev/ptp_ena symlink to identify the device.
To configure the chronyd daemon to use the PHC device
-
Edit
/etc/chrony.confusing a text editor and add the following line:refclock PHC /dev/ptp_ena poll 0 delay 0.000010 prefer -
Restart chrony.
[ec2-user ~]$sudo systemctl restart chronyd -
Verify that chrony is using the PTP hardware clock. The PHC0 device must be the preferred time source with a Stratum 0 value. The local NTP time source (if configured) must have a Stratum 1 value.
[ec2-user ~]$chronyc sourcesMS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== #* PHC0 0 0 377 0 +184ns[ +198ns] +/- 5032ns ^- 169.254.169.123 1 4 377 8 -18us[ -18us] +/- 115us
Verify hardware packet timestamping
The ENA driver loaded with the PHC support provides access to hardware packet timestamping. You
can verify support for this functionality by using the
ethtool -T command.interface
For more information about using hardware packet timestamping, see the
packet timestamping Linux documentation
[ec2-user ~]$sudo ethtool -Tens5
Time stamping parameters for ens5:
Capabilities:
software-transmit
hardware-receive
software-receive
software-system-clock
PTP Hardware Clock: 0
Hardware Transmit Timestamp Modes: none
Hardware Receive Filter Modes:
none
all
If the output shows hardware-receive in the Capabilities list, hardware packet timestamping is available on your instance.