Skip to content

Changed kalman offset message to debug level #1877

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

Closed
wants to merge 1 commit into from

Conversation

jpds
Copy link
Contributor

@jpds jpds commented Apr 28, 2025

After deploying ntpd-rs on my systems, the system logs are peppered with:

ntp-daemon[2022]: 2025-04-28T22:16:44.902268Z  INFO ntp_proto::algorithm::kalman: Offset: -9.71569488420898+-5.958433943105912ms, frequency: -0.029784204729893793+-1.5403756385090928pp

Which isn't useful to the average system admin, hence reduce this message to debug.

@rnijveld
Copy link
Member

rnijveld commented May 1, 2025

This is the core functionality of our daemon (i.e. determining what the time and frequency offsets are). I'm not sure what should be an info level log message, if this is not it? If you're not interested in that information, you could also increase the log level to warn or higher?

@rnijveld
Copy link
Member

rnijveld commented May 1, 2025

I do think that the messages themselves might a little too spammy though: the formatting isn't great (way to many digits, most of them realistically completely useless information) and the number of messages might be too high especially when you have many sources (even more so with a low max poll interval) given that we get these messages most of the time when we receive a new packet from a source.

@jpds
Copy link
Contributor Author

jpds commented May 1, 2025

I'm interested in this message at info:

info!("Jumped offset by {}ms", change * 1e3);
- but not these ones.

@davidv1992
Copy link
Member

Perhaps the better solution here is to make those jumps a warning. Thinking about this, that makes a certain amount of sense to me as it is something that may cause issues (not all software likes the system time jumping around) although it can be unavoidable. What do you think @rnijveld

@jpds
Copy link
Contributor Author

jpds commented Jun 3, 2025

I have now been running ntpd-rs on 8 bare metal servers I manage for a month. Here are some stats of you folks on how noisy this single log message is:

Let's see the stats of how many messages in total ntpd-rs has produced, timestamp here is last 30 days:

SELECT host, count(message) FROM journald.logs WHERE ( timestamp >= $__fromTime AND timestamp <= $__toTime ) AND ( unit LIKE '%ntpd-rs%' ) GROUP by host ORDER by host

Screenshot From 2025-06-03 12-25-34

I have a host that's produced almost ¾ of a million messages. Let's filter out any message with 'kalman' in it:

SELECT host, count(message) FROM journald.logs WHERE ( timestamp >= $__fromTime AND timestamp <= $__toTime ) AND ( unit LIKE '%ntpd-rs%' ) AND ( NOT message LIKE '%kalman%' ) GROUP by host ORDER by host

Screenshot From 2025-06-03 12-26-39

Well, that host that has suddenly dropped to just 294 messages. The ones with other higher counts of 10k+ are because I have some hosts on a network that can't get to the local IPv6 server thanks to #1880 so that logs is being filled with INFO ntpd::daemon::system: new source messages.

Here's a graph of the volume of all messages:

Screenshot From 2025-06-03 12-36-27

And here's a graph of the same time period WITHOUT the kalman messages:

Screenshot From 2025-06-03 12-36-01

Here the light blue, green and orange are the messages related IPv6 source mentioned above.

Here's how quiet a host is with no IPv6 problems, or kalman messages:

Screenshot From 2025-06-03 12-37-34

Basically, on boot-up; does the initial DNS resolution for the pool servers, logs the IPs and is then... essentially... silent.

@rnijveld
Copy link
Member

Sorry for the slow response, we've been discussing this a little internally, but haven't quite figured out a way forward yet. We do agree that the number of messages is a concern at the very least, but we also think that just moving this log message to a lower level isn't the way forward. I've summed up our current considerations in #1912, if you have any ideas we'd love to hear them in there, but I'll close this PR for now until we've found a good solution going forward. Thanks for all the effort you've put into this so far though!

@rnijveld rnijveld closed this Jun 19, 2025
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

Successfully merging this pull request may close these issues.

3 participants