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
Add NTP support #19189
Comments
This issue has been mentioned on Matomo forums. There might be relevant details there: |
Hi @MadMaxInfinity, But what we imho could consider is adding a simple diagnostic, that checks if the current server time is out of sync with a (customizable) ntp server. |
I agree. Keeping your server clock in sync is the responsibility of the server admin. Where would you want to store the current time so it's cached for the subsequent request? Otherwise, running an extra NTP query for every request would be a massive burden on the NTP server. |
We could possibly just store a single delta value that would be the difference between the time provided by a configured NTP server and the current server time. Updated every hour or so (or configurable interval). Plus add a second configuration option for alerting purposes as a threshold, so that when the difference becomes larger than the configured threshold a warning would display in the dash or an email could be sent. We can discuss what the allowed default difference should be, I'd start with 60 seconds. |
@michalkleiner I don't think it's worth the effort to implement that all across Matomo. As mentioned above, the server admin can simply set up a cron to sync the server time with a certain ntp server. Also it might actually be enough to only implement that for the tracker. So that the time of a tracked visit would be shifted by the mismatching time to ensure the datetime stored in the database is correct in the end. This scenario might even be solvable with a custom plugin. |
Summary
Currently, matomo uses the server’s time.
But analytics would be more accurate if they are synced through NTP, and TOTP would be more resilient (read this to get why this is interesting) if matomo would manage a NTP setting and use it.
This can have other interests I don’t think of right now, so if others want to reply.
Your Environment
The text was updated successfully, but these errors were encountered: