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

Bug: Fix RTT report when multiple servers are included #875

Merged
merged 2 commits into from
Sep 25, 2023

Conversation

boris-ilijic
Copy link
Contributor

When executing RTT command for NATS cluster setup, RTT is probably not reported correctly for all servers within the cluster.

E.g. after the following command is executed:

n rtt -s tls://connect.ngs.global
tls://connect.ngs.global:

    tls://34.159.142.0:4222: 15.005017ms
   tls://34.89.235.191:4222: 13.955248ms
    tls://34.107.15.96:4222: 14.124726ms

each RTT reported above was measured for tls://connect.ngs.global host (which can be resolved to any IP above) and not for each specific IP listed above. So the report is misleading: it is correct for at least one IP, but probably not for all 3 of them.

This PR fixes that issue.

@boris-ilijic
Copy link
Contributor Author

The result of this fix can be seen more clearly if we apply --trace switch from PR: #876 .

RTT for global.ngs.com without applied fix:

nats rtt --trace 2                                                                                                                                 on git:rtt-verbose-mode|⚑1 o
RTT iterations for server: tls://connect.ngs.global
#1:	rtt=15.779399ms
#2:	rtt=15.860255ms

RTT iterations for server: tls://connect.ngs.global
#1:	rtt=16.551375ms
#2:	rtt=15.209163ms

RTT iterations for server: tls://connect.ngs.global
#1:	rtt=16.335726ms
#2:	rtt=15.195447ms

tls://connect.ngs.global:

   tls://34.89.235.191:4222: 15.819827ms
    tls://34.159.142.0:4222: 15.880269ms
    tls://34.107.15.96:4222: 15.765586ms

RTT for global.ngs.com with the applied fix:

nats rtt --trace 2                                                                                                                                         on git:rtt-full|⚑1 o
RTT iterations for server: tls://34.89.235.191:4222
#1:	rtt=15.64317ms
#2:	rtt=16.001344ms

RTT iterations for server: tls://34.159.142.0:4222
#1:	rtt=17.582668ms
#2:	rtt=15.36456ms

RTT iterations for server: tls://34.107.15.96:4222
#1:	rtt=15.038285ms
#2:	rtt=15.837548ms

tls://connect.ngs.global:

   tls://34.89.235.191:4222: 15.822257ms
    tls://34.159.142.0:4222: 16.473614ms
    tls://34.107.15.96:4222: 15.437916ms

@ripienaar
Copy link
Collaborator

Nice thank you @boris-ilijic. Are you able to sign your commits? thank you!

@boris-ilijic
Copy link
Contributor Author

@ripienaar Commit is signed

@ripienaar ripienaar merged commit 191856b into nats-io:main Sep 25, 2023
2 checks passed
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.

2 participants