Precision Time Protocol (PTP) uses hardware-level timestamps and dynamic path compensation to achieve sub-microsecond clock synchronization. This feature ensures timing consistency in distributed systems and is ideal for scenarios that require strict time accuracy, 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 network time synchronization protocol based on the IEEE 1588 standard. PTP uses technologies such as hardware-level timestamps, dynamic path compensation, and intelligent master-slave clock negotiation to overcome the millisecond-level error bottleneck of traditional network time protocols, such as Network Time Protocol (NTP). This bottleneck is primarily caused by software processing latency and network jitter. PTP provides sub-microsecond time synchronization for devices in distributed systems.
Compared to NTP, PTP offloads calculations using hardware timestamps. This reduces CPU and network resource consumption while achieving higher 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 exchange frequency) | High (relies on frequent message switching) |
Typical application | Financial trading | Internet servers, general devices |
The Alibaba Cloud PTP synchronization architecture uses a redundant deployment of active and standby atomic clocks at the zone level. The primary atomic clock synchronizes with GPS time and then builds a hierarchical synchronization topology using the IEEE 1588 PTP boundary clock protocol to deliver sub-microsecond time signals to ECS instances.
By default, ECS instances run the Chrony or NTP service for time synchronization. You can enable the PTP time synchronization service on supported regions and instance types to achieve high-precision time synchronization.
Scenarios
High-frequency financial trading: The sub-microsecond synchronization accuracy and hardware timestamps of PTP ensure strict alignment of order timing across exchanges. This avoids disputes over transaction order caused by clock drift. When combined with sub-microsecond jitter control on low-latency networks, PTP meets the strict requirements of high-frequency trading for timing fairness and compliance.
Limits
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 are supported. We recommend that you use official image versions.
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 region, instance type, and image that support PTP. Then, in the Advanced Settings (Optional) section, enable the PTP time synchronization service.
For an existing instance
If the physical server where the instance is located does not support PTP, you must restart the instance to migrate it to a supported physical server before you can enable 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 More drop-down list, choose .
In the Set PTP Time Synchronization Service dialog box, enable the PTP time synchronization service.
After you click OK, the PTP Time Synchronization Task window appears.
Click the task ID to view the task progress. After the task is complete, the dialog box automatically closes, and the PTP time synchronization service is enabled for the instance.
Cloud Assistant is pre-installed on public images.
Using public commands and plugin features requires Cloud Assistant.
Cloud Assistant public commands
Go to the Cloud Assistant page in the ECS console and switch to the Public Commands tab.
Find the
ACS-ECS-EnablePTP-for-linux.shcommand and click Execute in the Actions column.Select the running instance and click Execute.
Cloud Assistant plugin
Check whether the PHC hardware device exists.
If the PHC hardware device does not exist, submit a ticket.
lspci | grep 500cIf the PTP time synchronization service is enabled, the command returns the following information:

Run the Cloud Assistant command to check its version. The version must be
2.2.3.631or later. If the version is earlier, upgrade Cloud Assistant.acs-plugin-manager --versionConfirm that the Cloud Assistant plugin is available in the current region.
If the Cloud Assistant plugin is not available, submit a ticket.
acs-plugin-manager --list | grep ACS-PTP-MonitorInstall the driver using Cloud Assistant.
The command typically completes within 10 minutes.
acs-plugin-manager --exec --plugin ACS-PTP-Monitor --params --install --timeout 0Start the ptp-monitor service.
This command updates the chrony configuration, restarts chronyd, enables ptp-monitor to start on boot, and starts the ptp-monitor service.
acs-plugin-manager --exec --plugin ACS-PTP-Monitor --params --start
Installation package
Run the following command to check for the PHC hardware device.
lspci | grep 500cIf the PTP time synchronization service is enabled, the command returns the following information:

Run the following command to obtain the compressed script package. An Internet connection is required.
After you enable PTP for an ECS instance, you can 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.zipRun the following commands to 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, you can run the
sudo apt update && sudo apt install unzipcommand to installunzip.Run the following command to compile and install the driver.
bash ptp-monitor.sh --installRun the following command to confirm that the PTP driver is installed.
ptp-monitorcompiles the PTP driver based on the current operating system. The driver is namedptp_cipu.lsmod | grep ptp_cipuRun the following command to confirm that the PTP device file is generated.
ll /dev/ptp*If device file information is returned, the driver is running correctly:

Run the following command to configure chrony, restart the chronyd service, and run the ptp-monitor service.
bash ptp-monitor.sh --startAfter the chronyd service is restarted, the PTP clock source takes effect within tens of seconds. You can verify this by viewing the PTP time synchronization service for the instance.
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 More drop-down list, choose .
In the Set PTP Time Synchronization Service dialog box, disable the PTP time synchronization service.
After you click OK, the PTP Time Synchronization Task window appears.
Click the task ID to view the task progress. After the task is complete, the dialog box automatically closes, and the PTP time synchronization service is disabled for the instance.
Cloud Assistant is pre-installed on public images.
Using public commands and plugin features requires Cloud Assistant.
Cloud Assistant public commands
Go to the Cloud Assistant page in the ECS console and switch to the Public Commands tab.
Find the
ACS-ECS-DisablePTP-for-linux.shcommand and click Execute in the Actions column.Select the running instance and click Execute.
Cloud Assistant plugin
Run the following command to stop the ptp-monitor service.
Disabling PTP removes the PTP device. This action updates the chrony configuration file to remove the PTP hardware clock source, restarts the chronyd service to restore default clock services such as NTP, and stops the ptp-monitor program.
acs-plugin-manager --exec --plugin ACS-PTP-Monitor --params --stopInstallation package
Disable the PTP clock source.
Disabling PTP removes the PTP device. This action updates the chrony configuration file to remove the PTP hardware clock source, restarts the chronyd service to restore default clock services such as NTP, and stops the ptp-monitor program.
bash ptp-monitor.sh --stop
View the PTP time synchronization service for an instance
Run the chronyc sources command to view the status of configured time sources (PTP and NTP).
Sample output:
The following figure shows an example of an instance for which the PTP time synchronization service is enabled and configured. The instance is prioritizing the PTP hardware clock for synchronization and achieving nanosecond-level accuracy:

MS: The time source identifier.PHC0indicates the PTP hardware clock, and an IP address indicates an NTP server.#*indicates the current synchronization source, which means the instance is using the PTP hardware clock for synchronization.Stratum: The stratum level of the time source. A smaller value indicates higher accuracy (0 for an atomic clock or GPS, 1 for a directly connected high-precision source).Poll: The polling interval exponent. The current polling interval is2^Pollseconds. For example,Poll=4means 16 seconds.Reach: An octal value that indicates the success rate of the last eight synchronization attempts.LastRx: The time since the last response was received, in seconds.Last sample: The clock offset from the last measurement, in the formatoffset [raw offset] +/- error. This reflects the difference between the system time and the source time.
Monitor PTP time synchronization health
Run the chronyc tracking command to monitor and evaluate the health of the system clock. The command provides dynamic metrics such as time bias, frequency error, and network latency, which help ensure the reliability of time-sensitive applications such as financial trading.
Sample output:
As shown in the following figure, the time bias is at the nanosecond level (System time = 1 ns, RMS offset = 1,175 ns), which meets the requirements of high-precision scenarios. The frequency error is low (5.213 ppm), which indicates good hardware clock stability:

System time: The current bias between the system clock and the PTP hardware clockPHC0.slowindicates that the system time is 1 nanosecond slower (1 nanosecond = 10⁻⁹ seconds).RMS offset: The long-term root mean square offset, which is 1,175 nanoseconds in this example. This reflects the stability of the time synchronization.Frequency: The frequency bias of the system clock.slowindicates that the local clock is 5.213 microseconds slower per second than the PTP hardware clockPHC0(ppm = parts per million).Root delay: The total network latency to the root time source. The extremely low latency shown in the figure indicates a highly stable network environment.
FAQ
Can I enable or disable the PTP time synchronization service using OpenAPI?
You can enable or disable the PTP time synchronization service.
Create an instance: Call RunInstances and set the PtpStatus parameter in ClockOptions to enabled or disabled to create an ECS instance with the PTP time synchronization service enabled or disabled.
For an existing instance: Call ModifyInstanceClockOptions and set PtpStatus to enabled or disabled to enable or disable the PTP time synchronization service for the instance.
If the call is successful, a task ID (TaskId) is returned. You can call DescribeTasks, set TaskAction to ModifyInstanceClockOptions, and set TaskIds to the corresponding task ID, to query the real-time execution status of the task.
Call DescribeInstances and set AdditionalAttributes to CLOCK_OPTIONS to confirm whether the PTP time synchronization service is enabled for the instance.
Call RunCommand and run the relevant commands to complete the configuration.
Can PTP be used with NTP?
Yes, it can. PTP does not affect NTP. chronyd uses an internal algorithm to select the best clock source. Based on the configuration, it prioritizes PTP as the clock source.
When I install the driver, the "dkms: command not found" error is reported.
When you install the PTP driver, required tool packages are installed first. The dkms tool is one of these dependencies. You must resolve the dkms package installation issue. For detailed error logs about the driver installation failure, see /var/log/ptp-cipu-ptp-monitor.log.
Scenario 1: The repo source configuration may not be up to date. Update the repo source and try again.
Scenario 2: Go to the official dkms website to obtain the corresponding installation package.
How do I enable or disable auto-start for the ptp-monitor program?
ptp-monitor is an operations and maintenance (O&M) component that runs on the instance. We recommend keeping it running, but it is not mandatory. By default, this component is configured to start automatically on boot.
Disable auto-start on boot.
acs-plugin-manager --exec --plugin ACS-PTP-Monitor --params --disable-serviceEnable 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 is named ptp_cipu. This driver is required for the PTP feature and its installation does not affect the instance. To uninstall the PTP driver, run the following Cloud Assistant command:
acs-plugin-manager --exec --plugin ACS-PTP-Monitor --params --uninstall