iridium77 / htpdate

59 stars 14 forks source link

htpdate accuracy question #1

Open matteoraggi opened 7 years ago

matteoraggi commented 7 years ago

The accuracy of htpdate is at least -+0.5 seconds and better with multiple servers, but huw muc hbetter? the only way to improve the accuracy is this option? -b Burst mode uses multiple polls for each web server to enhance accuracy.

iridium77 commented 7 years ago

My interpretation of what the original author wrote in README:

The granularity of HTTP header "date" is 1 second. So even in an ideal environment, the max possible error of a single request is 0.5 seconds.

Burst mode tries to send N requests uniformly in 1 second. Based on how many of them return T, and how many return T+1, it can estimate the millisecond part, by computing the average.

I didn't use it, but ran against 4 different hosts instead. Similar idea about accuracy, but better connectivity and stability are more important in my use case.

matteoraggi commented 7 years ago

Thanks to clarify! So the only way to grow the time quality is the -b option. I can't figure how ntpd could better of htpdate...

iridium77 commented 7 years ago

I'm afraid that your conclusions are totally the opposite of what I wrote :(

  1. Using multiple hosts is another choice than "-b".
  2. Ntpd can definitely get better precision. Take 5 minutes to read the NTP protocol. It supports fraction part of 1 second, but HTTP header doesn't.
matteoraggi commented 7 years ago

Aha, I am very often back to firewall that I don't want to loose time configure about, so I would like to use htpdate instead of ntpd. Which is the option to use multiple hosts for htpdate? Is it possible to use both multiple hosts and -b option too? I cna't use NTP because of the firewalls locking it, right?

iridium77 commented 7 years ago

Read README. Yes. Ask the owner of "the firewalls", or try by yourself.

matteoraggi commented 7 years ago

nono, I can't manage the firewalls for every situation, I prefer to use htpdate instead of ntpd. But why ntpd is more precise of htpdate?

iridium77 commented 7 years ago

Smaller granularity. Please read my 2nd comment.

matteoraggi commented 7 years ago

You are right, but NTP is locked from firewalls, thanks for the patience, i foudn another and better solution maybe: RadioClock! I just need to find a hardware and not a DIY and a software for debian/raspbian.