[Linuxptp-users] Plotting chrony drift to evaluate a PTP setup?
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
|
From: C. D. <cd...@ou...> - 2019-03-26 13:02:31
|
Hello
After some basic copy paste mistakes (oops), I now have PTP mostly working.
My grandmasters still have no stratum 0 reference, but for the first cluster, I found about 10 public stratum-1 NTP server less than 9 ms away. That’ll have to do.
For the second cluster, it’s even better: only 1 ms away, so most of the time, `chronyc sources` gives me offset values below 50us, which is good enough for my needs, so that is the value I am distributing to the cluster by PTP.
On the PTP master, I have
MS Name/IP address Stratum Poll Reach LastRx Last sample
(…)
^* stratum-1 1 4 377 12 +30us[ +29us] +/- 802us
However, the cluster accuracy is still quite off target:
MS Name/IP address Stratum Poll Reach LastRx Last sample
(…)
* PTP0 0 2 377 5 -670ns[-1045ns] +/- 5885ns
To better understand what I am doing, I am now plotting the results to check how my “fixes” and different scenarios impact the jitter of server.
For example, I wonder in pract9ce :
- which minpoll and maxpoll are sufficient on the cluster grandmaster given the lack of stratum-0 local source,
- how drift is impacted by traffic, cpu load etc, even with the options lock_all and sched_priority 1 on the server emitting PTP
- how traffic etc impact the servers receiving PTP
- how clock_source hpet fares compared to tsc, on the PTP master and clients
- when servers running real-time Linux are added to the cluster, how they will perform (better or worse?)
I have read many ways to do such plots with gnuplot for NTP, but none for chrony and PTP so I wrote the following very basic script to check how well I do against my reference, here 2001:aaa:bbb:ccc::
#!/bin/sh
IPV6=”2001:aaa:bbb:ccc::”
grep "$IPV6" /var/log/chrony/statistics.log | \
awk '{ print $1 "T" $2,$5}' | \
gnuplot-nox -e " jitter = '<cat';
set title '$HOST';
set xdata time;
set xtics 0,3600 format \"%m-%d %Hh\" time rotate;
plot jitter using (timecolumn(1, \"%Y-%m-%dT%H:%M:%S\")):2 title \"chrony stat col 5 data\";
"
Here’s the output for the PTP master of the 2nd cluster, getting it’s data via NTP from a stratum1 server about 1 ms away, without any kind of offset adjustment: it seems quite good for NTP.
[cid:image003.png@01D4E3AE.037F5C40]
Would anyone know how to do that plot better, by taking advantage of the extra variables chrony offers when using log measurements statistics tracking?
I’m especially interested in doing that for the PTP clients: the plotting is not so much of a problem, knowing what I should plot is!
I wonder what actionable data should I add?
Here’s the output for the PTP slave after restarting timemaster. Yes, there are some weird initial outliers at 450 us that don’t exist in the PTP master
[cid:image006.png@01D4E3AE.037F5C40]
If I exclude these, there is a lot of dispertion in the +-1 us band, with small periods of stability, and what look like oscilliations
[cid:image011.png@01D4E3AE.037F5C40]
But they do not last long, and the clock doesn’t converge.
[cid:image012.png@01D4E3AE.037F5C40]
My guess is that the PTP master does too many corrections while trying to follow the stratum 1 servers: the corrections are small for the master, but large for the NTP clients because of my unusual setup (PTP master with a stratum-1 reference instead of stratum-0)
|