Precision Time Protocol (PTP) delivers sub-microsecond clock synchronization with hardware timestamps for distributed systems, such as high-frequency financial trading.
What is PTP
The PTP time synchronization feature is currently in invitational preview. To use this feature, submit a ticket to apply.
Precision Time Protocol (PTP) is a high-precision time synchronization protocol based on IEEE 1588. PTP uses hardware timestamps, dynamic path compensation, and master-slave clock negotiation to overcome the millisecond-level accuracy limit of Network Time Protocol (NTP), which is caused by software processing latency and network jitter. PTP delivers sub-microsecond synchronization for distributed systems.
Compared to NTP, PTP offloads timestamp processing to hardware, reducing CPU and network overhead while improving accuracy:
|
Feature |
PTP |
NTP |
|
Accuracy |
Sub-microsecond |
Millisecond |
|
Timestamp implementation |
Hardware support (such as PHC devices) |
Software implementation |
|
Network environment |
Local area network or low-latency |
Wide area network |
|
Resource consumption |
Low (controllable message frequency) |
High (relies on frequent message exchanges) |
|
Typical application |
Financial trading |
Internet servers, general devices |
Alibaba Cloud deploys redundant active-standby atomic clocks per zone. The primary clock synchronizes with GPS and builds a hierarchical topology using IEEE 1588 boundary clocks to deliver sub-microsecond time signals to ECS instances.
By default, ECS instances use Chrony or NTP for time synchronization. You can enable PTP on supported regions and instance types for sub-microsecond accuracy.
Use cases
High-frequency financial trading: PTP hardware timestamps align order timing across exchanges at sub-microsecond precision, preventing disputes from clock drift and meeting timing fairness and compliance requirements.
Limitations
-
Supported regions and zones:
Region Name
Region ID
Zone Name
Zone ID
China (Hong Kong)
cn-hongkong
Zone B (Invitational Preview)
cn-hongkong-b
Zone C (Invitational Preview)
cn-hongkong-c
Zone D (Invitational Preview)
cn-hongkong-d
-
Supported instance families:
You can call the DescribeInstanceTypes operation to query whether an instance type is supported. If the PtpSupport parameter in the Clock parameter of the response is set to supported, the instance type supports PTP. If the instance type does not support PTP, the PtpSupport parameter is not included in the response.
-
General-purpose instance family g9i, compute-optimized instance family c9i, and memory-optimized instance family r9i (invitational preview)
-
General-purpose ECS Bare Metal Instance families ebmg9i, ebmc9i, and ebmr9i (invitational preview)
-
High-clock speed compute-optimized instance family hfc9i, high-clock speed general-purpose instance family hfg9i, and high-clock speed memory-optimized instance family hfr9i
-
-
Supported images: Linux images only. Official image versions are recommended.
-
The Linux kernel version must be 4.12 or later.
Enable or disable PTP for an ECS instance
Enable the PTP time synchronization service
-
Enable PTP in the console
-
Create an instance
Go to the Custom Launch tab in the ECS console. Select a PTP-supported region, instance type, and image. In the Advanced Options section, enable PTP.
-
For an existing instance
If the physical server does not support PTP, restart the instance to migrate it to a supported server before enabling PTP.
-
Go to the and click the ID of the target instance to go to the instance details page.
-
On the Instance Details page, from the All Operations drop-down list, choose .
-
In the Set PTP Time Synchronization Service dialog box, enable PTP.
After you click OK, the PTP Time Synchronization Task window appears.
-
Click the task ID to view progress. After the task completes, PTP is enabled for the instance.
-
-
-
Cloud Assistant is pre-installed on public images.
Public commands and plugin features require Cloud Assistant.
Cloud Assistant common commands
-
Go to the ECS console - Cloud Assistant page and switch to the Common Commands tab.
-
Find the
ACS-ECS-EnablePTP-for-linux.shcommand and click Run in the Actions column. -
Select the running instance and click Run.
Cloud Assistant plugin
-
Check whether the PHC hardware device exists.
If the PHC hardware device does not exist, submit a ticket.
lspci | grep 500cIf PTP is enabled, the command returns:

-
Check the Cloud Assistant version. Version
2.2.3.631or later is required. If earlier, upgrade Cloud Assistant.acs-plugin-manager --version -
Confirm the Cloud Assistant plugin is available in the current region.
If the plugin is not available, submit a ticket.
acs-plugin-manager --list | grep ACS-PTP-Monitor -
Install the driver with Cloud Assistant.
Typically completes within 10 minutes.
acs-plugin-manager --exec --plugin ACS-PTP-Monitor --params --install --timeout 0 -
Start the ptp-monitor service.
Updates chrony configuration, restarts chronyd, enables ptp-monitor auto-start, and starts ptp-monitor.
acs-plugin-manager --exec --plugin ACS-PTP-Monitor --params --start
Installation package
-
Check for the PHC hardware device.
lspci | grep 500cIf PTP is enabled, the command returns:

-
Download the compressed script package. An Internet connection is required.
After enabling PTP, use the
ptp-monitorscript for one-click deployment and configuration.wget https://ptp-monitor-hk.oss-cn-hongkong.aliyuncs.com/ptp-monitor/ptp-monitor-latest.zip -
Decompress the package.
yum install -y unzip unzip ptp-monitor-latest.zip -d ptp-monitor-latest cd ptp-monitor-latestOn operating systems such as Ubuntu and Debian, run
sudo apt update && sudo apt install unzipto installunzip. -
Compile and install the driver.
bash ptp-monitor.sh --install -
Confirm the PTP driver is installed.
ptp-monitorcompiles the PTP driver based on the current operating system. The driver is namedptp_cipu.lsmod | grep ptp_cipu -
Confirm the PTP device file is generated.
ll /dev/ptp*If device file information is returned, the driver is running correctly.

-
Configure chrony, restart chronyd, and start ptp-monitor.
bash ptp-monitor.sh --startThe PTP clock source takes effect within tens of seconds. Verify by viewing the PTP synchronization status.
-
Disable the PTP time synchronization service
-
Disable PTP in the console
-
Go to the and click the ID of the target instance to go to the instance details page.
-
On the Instance Details page, from the All Operations drop-down list, choose .
-
In the Set PTP Time Synchronization Service dialog box, disable PTP.
After you click OK, the PTP Time Synchronization Task window appears.
-
Click the task ID to view progress. After the task completes, PTP is disabled for the instance.
-
-
Cloud Assistant is pre-installed on public images.
Public commands and plugin features require Cloud Assistant.
Cloud Assistant common commands
-
Go to the ECS console - Cloud Assistant page and switch to the Common Commands tab.
-
Find the
ACS-ECS-DisablePTP-for-linux.shcommand and click Run in the Actions column. -
Select the running instance and click Run.
Cloud Assistant plugin
Stop the ptp-monitor service.
Disabling PTP removes the PTP device, updates chrony to remove the PTP hardware clock source, restarts chronyd to restore default clock services such as NTP, and stops ptp-monitor.
acs-plugin-manager --exec --plugin ACS-PTP-Monitor --params --stopInstallation package
Disable the PTP clock source.
Disabling PTP removes the PTP device, updates chrony to remove the PTP hardware clock source, restarts chronyd to restore default clock services such as NTP, and stops ptp-monitor.
bash ptp-monitor.sh --stop -
View PTP synchronization status
Run chronyc sources to view configured time sources (PTP and NTP).
Sample output:
The following example shows an instance using the PTP hardware clock as its primary synchronization source at nanosecond-level accuracy:

-
MS: Time source identifier.PHC0indicates the PTP hardware clock; an IP address indicates an NTP server.#*marks the active synchronization source. In this example, the instance uses the PTP hardware clock. -
Stratum: Stratum level. Lower values indicate higher accuracy (0 = atomic clock or GPS, 1 = directly connected high-precision source). -
Poll: Polling interval exponent. Interval =2^Pollseconds. For example,Poll=4= 16 seconds. -
Reach: Octal value indicating the success rate of the last eight synchronization attempts. -
LastRx: Seconds since the last response was received. -
Last sample: The clock offset from the last measurement, in the formatoffset [raw offset] +/- error, reflecting the difference between system time and source time.
Monitor PTP synchronization health
Run chronyc tracking to view system clock health metrics, including time bias, frequency error, and network latency.
Sample output:
In this example, the time bias is at the nanosecond level (System time = 1 ns, RMS offset = 1,175 ns) and the frequency error is low (5.213 ppm), indicating stable hardware clock operation:

-
System time: Bias between the system clock and PTP hardware clockPHC0.slowmeans the system time is 1 nanosecond behind (1 ns = 10⁻⁹ s). -
RMS offset: Long-term root mean square offset (1,175 ns in this example), reflecting synchronization stability. -
Frequency: System clock frequency bias.slowmeans the local clock runs 5.213 µs/s slower thanPHC0(ppm = parts per million). -
Root delay: Total network latency to the root time source. Low latency indicates a stable network environment.
FAQ
Can I enable or disable the PTP time synchronization service using OpenAPI?
-
You can enable or disable PTP via OpenAPI.
-
Create an instance: Call RunInstances and set PtpStatus in ClockOptions to enabled or disabled.
-
For an existing instance: Call ModifyInstanceClockOptions and set PtpStatus to enabled or disabled.
On success, a task ID (TaskId) is returned. Call DescribeTasks with TaskAction set to ModifyInstanceClockOptions and TaskIds set to the task ID to query task status.
-
-
Call DescribeInstances with AdditionalAttributes set to CLOCK_OPTIONS to verify PTP status.
-
Call RunCommand to run the relevant commands to complete configuration.
Can PTP be used with NTP?
Yes. PTP does not affect NTP. chronyd uses an internal algorithm to select the best clock source and prioritizes PTP based on the configuration.
When I install the driver, the "dkms: command not found" error is reported.
PTP driver installation first installs required tool packages including dkms. Resolve the dkms package installation issue. For detailed error logs, see /var/log/ptp-cipu-ptp-monitor.log.
-
Scenario 1: The repo source may be outdated. Update the repo source and try again.
-
Scenario 2: Download the package from the official dkms website.
How do I enable or disable auto-start for the ptp-monitor program?
ptp-monitor is an O&M component running on the instance. Keeping it running is recommended but not mandatory. By default, it starts automatically on boot.
-
Disable auto-start on boot.
acs-plugin-manager --exec --plugin ACS-PTP-Monitor --params --disable-service -
Enable auto-start on boot.
acs-plugin-manager --exec --plugin ACS-PTP-Monitor --params --enable-service
How do I uninstall the PTP driver?
The PTP driver (ptp_cipu) is required for PTP and does not affect the instance. To uninstall it, run the following Cloud Assistant command:
acs-plugin-manager --exec --plugin ACS-PTP-Monitor --params --uninstall