Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected behaviour with poll-interval configuration #1811

Open
lperlaki opened this issue Jan 30, 2025 · 2 comments
Open

Unexpected behaviour with poll-interval configuration #1811

lperlaki opened this issue Jan 30, 2025 · 2 comments

Comments

@lperlaki
Copy link

Our usecase

Initial time sync at startup and then polling with big intervals, since our application is not sensitive to (milli-)second precise timestamps.

Relevant file: ntp.toml

[source-defaults]

Some values are shared between all sources in the daemon. You can configure these in the [source-defaults] section.

poll-interval-limits = { min = min, max = max } ({ min = 4, max = 10})

Specifies the limit on how often a source is queried for a new time. For most instances the defaults will be adequate. The min and max are given as the log2 of the number of seconds (i.e. two to the power of the interval). An interval of 4 equates to 32 seconds, 10 results in an interval of 1024 seconds. If specified, both min and max must be specified.

initial-poll-interval = interval (4)

Initial poll interval used on startup. The value is given as the log2 of the number of seconds (i.e. two to the power of the interval). The default value of 4 results in an interval of 32 seconds.

we tested with poll-interval-limits = { min = 2, max = 10} and initial-poll-interval = 5,
which should result in 4 second interval as min value and 32 second interval as initial value

Expected behavior

  • ntpd-rs polls the nts server with interval initial-poll-interval until the local time is updated (or confirmed)
  • ntpd-rs changes the interval to something within the poll-interval-limits
  • ntpd-rs polls with the new interval from now on

Actual behavior

  • ntpd-rs polls the nts server with interval poll-interval-limits min value for 8 times
  • ntpd-rs changes the poll interval to initial-poll-interval (ONLY if it is within the range of poll-interval-limits)
  • ntpd-rs polls with the new interval from now on

Other info

OS: FreeBSD 14.2
ntpd-rs version: 1.3.1 (since only this is available via pkg install)

@davidv1992
Copy link
Member

Thanks for your input. The documentation is terrible in explaining this right now, but the current behavior is actually a somewhat intentional choice. This means we don't have support for what you want yet (startup bursts). The initial-poll-interval is actually more intended as a starting point for the algorithm that decides how much we want to poll, and as such is forced between the limits just like the output of that algorithm.

I'm going to leave this open as a reminder that we need to improve the documentation, but I can't promise a timeline on that.

@davidv1992
Copy link
Member

The wish to implement startup bursts is already part of #270

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants