The PTP time synchronization service synchronizes the clock of an ECS instance with an Alibaba Cloud atomic clock source over the Precision Time Protocol (PTP). Use PTP for workloads that require tighter clock alignment than software-based network time protocols can provide, such as high-frequency financial trading.
What is PTP
PTP is a high-precision network time synchronization protocol based on the IEEE 1588 standard. Traditional network time protocols such as NTP are limited to millisecond-level accuracy, mainly because of software processing latency and network jitter. PTP uses hardware timestamps, dynamic path compensation, and intelligent master-slave clock negotiation to overcome that limit and synchronize the clocks of devices in a distributed system.
Compared to NTP, PTP offloads timestamp processing to hardware, which reduces CPU and network overhead and improves 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 | Industrial control, financial trading, and 5G communications | Internet servers, general devices |
How PTP works on Alibaba Cloud
Alibaba Cloud deploys redundant active-standby atomic clocks at the zone level. The primary atomic clock synchronizes with GPS time and then builds a hierarchical time synchronization topology based on the IEEE 1588 PTP boundary clock protocol, which delivers time signals to ECS instances level by level.
By default, ECS instances use Chrony or NTP for time synchronization.
Use cases
High-frequency financial trading — The sub-microsecond accuracy and hardware timestamps of PTP keep order timing strictly aligned across exchanges and prevent trading-sequence disputes caused by clock drift. Combined with sub-microsecond jitter control on low-latency networks, PTP meets the strict timing fairness and compliance requirements of high-frequency trading.
Prerequisites
Before you enable the PTP time synchronization service for an ECS instance, confirm that your service access, instance resources, and in-instance environment meet the following requirements.
Service access
Invitational preview — The PTP time synchronization feature is currently in invitational preview. To use this feature, submit a ticket to apply.
Instance resources
Regions and zones
PTP is supported in the following 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 |
Instance families
PTP is supported by the following instance families:
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
To check whether a specific instance type supports PTP, call the DescribeInstanceTypes operation. If the
PtpSupportparameter in theClockparameter of the response is set tosupported, the instance type supports PTP. If the instance type does not support PTP, thePtpSupportparameter is not included in the response.
Images
Linux images are supported. (Recommended) Use a maintained official image version. The following table lists the supported operating system versions.
Operating system | Supported versions |
Alibaba Cloud Linux | 2 to 4 |
Anolis OS | 8 |
Debian | 11 to 13 |
Ubuntu | 18.04 LTS to 26.04 LTS |
AlmaLinux | 8 to 10 |
Rocky Linux | 8 to 10 |
CentOS Stream | 8 to 10 |
RHEL | 9 to 10 |
Fedora | 33 to 44 |
OpenSUSE | 15.6, 16.0 |
SLES | 15SP2 to SP7, 16.0 |
Kernel version
The Linux kernel version must be 4.12 or later.
In-instance environment
Cloud Assistant — The public command method and the plugin method require Cloud Assistant, which is pre-installed on public images. If Cloud Assistant is not installed, see install the Cloud Assistant Agent.
Internet access — The installation package method downloads the
ptp-monitorscript package over the internet. Make sure that the instance can access the internet.
Step 2: Create or add ECS instances in the deployment set
All ECS instances in a deployment set are deployed within the same network topology scope (PSW) in the same zone, which reduces network latency. The instances are also distributed across different physical servers as much as possible to reduce the business impact of a single-server failure.
Create ECS instances with the PTP time synchronization service enabled in the deployment set, or enable the PTP time synchronization service for existing ECS instances and add them to the deployment set:
Console
The instance type, region, and number of ECS instances must comply with the limitations. For more information, see Limitations.
Create a new instance in a deployment set:
On the deployment set list page, find the target deployment set. In the Actions column, click Create Instance. On the Custom Launch page, complete the instance configuration.
Add an existing instance to a deployment set: See Change instance deployment set.
API
Create a new instance in a deployment set: Call the RunInstances operation and specify the
DeploymentSetIdparameter.Add an existing instance to a deployment set: Call the ModifyInstanceDeployment operation and specify the
InstanceIdandDeploymentSetIdparameters.NoteIf the specified deployment set uses the
AvailabilityGroupstrategy (high availability group strategy), you can use theDeploymentSetGroupNoparameter to specify the group number for the instance within the deployment set.
Step 3: Configure PTP for the instances in the deployment set
Install the PTP driver on each instance in the deployment set and configure the PTP clock in chrony. For instructions, see Enable the PTP time synchronization service.
Enable the PTP time synchronization service
Enabling PTP for an ECS instance takes two stages. In Stage 1, you enable the PTP time synchronization service for the instance in the ECS console. In Stage 2, you install the PTP driver and configure chrony inside the instance. The instance does not use the PTP clock source until both stages are complete.
Stage 1: Enable PTP for the instance in the ECS console
Create an instance with PTP enabled
Go to theCustom Launch tab in the ECS console page. Select a region, instance type, and image that support PTP, and then enable the PTP time synchronization service in the Advanced Options section.
Enable PTP for an existing instance
If the current physical server of the instance does not support PTP, restart the instance to migrate it to a physical server that supports PTP, and then enable PTP.
Go to and click the ID of the target instance to go to the instance details page.
On the Instance Details page, choose All Operations > Instance Settings > Configure PTP Clock Synchronization Service.
In the Configure PTP Clock Synchronization Service dialog box, enable the PTP time synchronization service and 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 closes automatically and PTP is enabled for the instance.
Stage 1 enables the PTP capability for the instance only. Continue with Stage 2 to make the PTP clock source take effect.
Stage 2: Install the PTP driver and configure chrony in the instance
Choose a configuration method and complete the steps in the corresponding tab.
Public commands and plugin features require Cloud Assistant. The following table describes when to use each method:
Method | Use when | Requirements |
Cloud Assistant common commands (Recommended) | You want to enable PTP from the console in a single operation, without logging on to the instance. | Cloud Assistant installed on the instance. |
Cloud Assistant plugin | You want to run each action separately, such as checking the PHC device or controlling the ptp-monitor service. | Cloud Assistant |
Installation package | The instance does not use a public image. | Internet access from the instance to download the script package. |
Cloud Assistant common commands
Go toECS console - Cloud Assistant page and click 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.
After the command finishes, confirm that the instance uses the PTP hardware clock. For instructions, see Verify and monitor PTP synchronization.
Cloud Assistant plugin
Check whether the PHC hardware device exists.
lspci | grep 500cAfter the PTP time synchronization service is enabled, the command returns the following information:
[root@ixxx ~]# lspci | grep 500c 00:07.0 Unclassified device [00ff]: Alibaba (China) Co., Ltd. Device 500cIf the PHC hardware device does not exist, submit a ticket.
Run the Cloud Assistant command to check its version.
acs-plugin-manager --versionThe version must be
2.2.3.631or later. If the version is earlier, upgrade Cloud Assistant.Confirm that the Cloud Assistant plugin is available in the current region.
acs-plugin-manager --list | grep ACS-PTP-MonitorIf the Cloud Assistant plugin does not exist, submit a ticket.
Install the driver with Cloud Assistant. The command usually completes within 10 minutes.
acs-plugin-manager --exec --plugin ACS-PTP-Monitor --params --install --timeout 0If the installation does not complete, see Why does the "dkms: command not found" error occur when I install the driver? for the driver installation log path and the common causes.
Start the ptp-monitor service. This updates the chrony configuration, restarts chronyd, enables ptp-monitor to start on boot, and starts ptp-monitor.
acs-plugin-manager --exec --plugin ACS-PTP-Monitor --params --startConfirm that the instance uses the PTP hardware clock. For instructions, see Verify and monitor PTP synchronization.
Installation package
Run the following command to check the PHC hardware device.
lspci | grep 500cAfter the PTP time synchronization service is enabled, the command returns the following information:
[root@ixxx ~]# lspci | grep 500c 00:07.0 Unclassified device [00ff]: Alibaba (China) Co., Ltd. Device 500cRun the following command to download the compressed script package. Internet access is required. After PTP is enabled for an ECS instance, the
ptp-monitorscript completes deployment and configuration in one operation.wget https://ptp-monitor-hk.oss-cn-hongkong.aliyuncs.com/ptp-monitor/ptp-monitor-latest.zipInstall
unzipand decompress the package. On operating systems that useyum, run the following commands: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 the following commands:
sudo apt update && sudo apt install unzip unzip ptp-monitor-latest.zip -d ptp-monitor-latest cd ptp-monitor-latestRun the following command to compile and install the driver.
bash ptp-monitor.sh --installIf the installation fails, see Why does the "dkms: command not found" error occur when I install the driver? for the driver installation log path and the common causes.
Run the following command to confirm that the PTP driver is installed.
ptp-monitorcompiles the PTP driver based on the current operating system version. The driver is namedptp_cipu.lsmod | grep ptp_cipuRun the following command to confirm that the PTP device file is generated.
ls -l /dev/ptp*If device file information is returned, the driver is running correctly:
[root@xxxxxxxxxx ~]# ll /dev/ptp* crw------- 1 root root 247, 0 Jul 30 11:22 /dev/ptp0Run the following command to configure chrony, restart the chronyd service, and run the ptp-monitor service.
bash ptp-monitor.sh --startAfter you restart the chronyd service, the PTP clock source takes effect within tens of seconds. You can verify this by viewing the PTP synchronization status.
Verify and monitor PTP synchronization
After you enable the PTP time synchronization service, use the chronyc commands to confirm that the ECS instance uses the PTP hardware clock and to keep track of clock health.
View the PTP synchronization status
Run chronyc sources to view the status of the configured time sources (PTP and NTP). PTP synchronization is working when the PHC0 source is marked with #*.
Sample output:
The following example shows an instance that has the PTP time synchronization service enabled and configured. The instance uses the PTP hardware clock as its primary synchronization source, and the measured offset is at the nanosecond level:
[root@iZxxx Z ptp-monitor-latest]# chronyc sources
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
#* PHC0 0 4 56 37 -28ns[ -13ns] +/- 320nsMS: the time source identifier.PHC0indicates the PTP hardware clock. An IP address indicates an NTP server.#*marks the current synchronization source, which means that the instance is using the PTP hardware clock.Stratum: the stratum of the time source. A lower value indicates higher accuracy (0 is an atomic clock or GPS, and 1 is a directly connected high-precision source).Poll: the polling interval exponent. The current polling interval is2^Pollseconds. For example,Poll=4indicates 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, which reflects the difference between the system time and the source time.
Monitor PTP synchronization health
Run chronyc tracking to monitor and evaluate the health of the system clock, including dynamic metrics such as time bias, frequency error, and network latency, to ensure reliability for time-sensitive applications such as financial trading.
Sample output:
In the following example, the measured time bias is at the nanosecond level (System time = 1 ns, RMS offset = 1,175 ns), which meets high-precision requirements, and the frequency error is low (5.213 ppm), which indicates stable hardware clock operation:
[root@iZ*** ptp-monitor-latest]# chronyc tracking
Reference ID : 50484330 (PHC0)
Stratum : 1
Ref time (UTC) : Fri Aug 08 02:52:40 2025
System time : 0.000000001 seconds fast of NTP time
Last offset : -0.000000973 seconds
RMS offset : 0.000001175 seconds
Frequency : 5.213 ppm slow
Residual freq : -0.001 ppm
Skew : 0.031 ppm
Root delay : 0.000000001 seconds
Root dispersion : 0.000038351 seconds
Update interval : 16.0 seconds
Leap status : NormalSystem time: the current bias between the system clock and the PTP hardware clockPHC0.slowmeans that the system time is 1 nanosecond behind (1 ns = 10⁻⁹ s).RMS offset: the long-term root mean square offset, which is 1,175 nanoseconds in this example and reflects synchronization stability.Frequency: the frequency bias of the system clock.slowmeans that the local clock runs 5.213 microseconds per second slower than the PTP hardware clockPHC0(ppm = parts per million).Root delay: the total network latency to the root time source. The very low latency in the figure indicates a highly stable network environment.
Disable the PTP time synchronization service
Disabling PTP takes the same two stages as enabling it. In Stage 1, you disable the PTP time synchronization service for the instance in the ECS console. In Stage 2, you remove the PTP clock source inside the instance.
Stage 1: Disable PTP for the instance in the ECS console
Go to and click the ID of the target instance to go to the instance details page.
On the Instance Details page, choose All Operations > Instance Settings > Configure PTP Clock Synchronization Service.
In the Configure PTP Clock Synchronization Service dialog box, disable the PTP time synchronization service and 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 closes automatically and PTP is disabled for the instance.
Stage 2: Remove the PTP clock source in the instance
Disabling PTP removes the PTP device. This 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.
Choose a method and complete the steps in the corresponding tab.
Public commands and plugin features require Cloud Assistant. Cloud Assistant is pre-installed on public images. For an instance that does not use a public image, use the installation package.
Cloud Assistant common commands
Go toECS console - Cloud Assistant page and click 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
Run the following command to stop the ptp-monitor service.
acs-plugin-manager --exec --plugin ACS-PTP-Monitor --params --stopInstallation package
Run the following command to disable the PTP clock source.
bash ptp-monitor.sh --stopConfirm that PTP is disabled
Run chronyc sources to confirm that the PHC0 source is no longer listed and that the instance synchronizes with an NTP server. For instructions, see View the PTP synchronization status.
To use PTP on the instance again, repeat the procedure in Enable the PTP time synchronization service. To remove the PTP driver from the instance, see How do I uninstall the PTP driver?.
FAQ
Can I enable or disable the PTP time synchronization service by using OpenAPI?
Yes. Use the instance creation operation for new instances and the clock options operation for existing instances, and then run the in-instance configuration commands remotely.
Create an instance: call the RunInstances operation and set
PtpStatusinClockOptionstoenabledordisabledto create an ECS instance with the PTP time synchronization service enabled or disabled.For an existing instance: call the ModifyInstanceClockOptions operation and set
PtpStatustoenabledordisabledto enable or disable the PTP time synchronization service for the instance.On success, a task ID (
TaskId) is returned. You can call the DescribeTasks operation withTaskActionset toModifyInstanceClockOptionsandTaskIdsset to the corresponding task ID to query the execution status of the enable or disable operation in real time.Check the result: call the DescribeInstances operation with
AdditionalAttributesset toCLOCK_OPTIONSto confirm whether the PTP time synchronization service is enabled for the instance.Configure the instance: call the RunCommand operation to run the relevant commands and complete the 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.
Why does the "dkms: command not found" error occur when I install the driver?
Installing the PTP driver first installs the required tool packages, and dkms is one of them, so 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: get the corresponding installation 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 that runs inside the instance. Keeping it running is recommended but not mandatory. After installation, the component starts automatically on boot by default.
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-serviceHow do I uninstall the PTP driver?
The PTP driver is named ptp_cipu. The driver is required for the PTP feature, and installing it 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