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

core(network-request): exclude dns from rtt estimates #15110

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

connorjclark
Copy link
Collaborator

See a summary of how DNS works - at no point does it send a request to the actual server (that's the whole point of DNS - where is the server even?), so it doesn't make sense to include it in an estimate for server RTT.

@connorjclark connorjclark requested a review from a team as a code owner May 24, 2023 18:01
@connorjclark connorjclark requested review from brendankenny and removed request for a team May 24, 2023 18:01
@adamraine
Copy link
Member

I think this makes some sense. However our network throttling settings treat RTT as a property of the network as a whole, rather than a property of a single server. Even though we aren't connecting directly to the origin's server, that RTT time is still a necessary step for connecting to the origin.

Perhaps the most accurate calculation would involve separating the DNS RTT from the actual server RTT but that probably isn't worth the effort.

I can't say I'm swaying in one direction or the other at this point, but the difference seems to be minimal.

@connorjclark
Copy link
Collaborator Author

I think this makes some sense. However our network throttling settings treat RTT as a property of the network as a whole, rather than a property of a single server.

(relevant code: load-simulator.js)

The Simulator's options.rtt is indeed a property of the local network - how much additional rtt to add to every request on 3g for example. But there is also options.additionalRttByOrigin. The network analyzer computes both a rtt (the minimum of the observed rtt to all origins) and additionalRttByOrigin (per-origin latencies) - the simulator's rtt is set to that observed minimum only for provided, but additionalRttByOrigin is always used.

I believe the Simulator's options.rtt property only wants to capture how much rtt to add to every outbound request, to any server (including DNS servers). The estimate given by NetworkAnalysis is exactly that, and for the reasons listed above it's best to exclude the highly variable DNS roundtrips from that estimate.

@connorjclark
Copy link
Collaborator Author

Updated branch, but let's wait for lantern trace database refresh.

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

Successfully merging this pull request may close these issues.

None yet

4 participants