Closed Bug 1761528 Opened 2 years ago Closed 2 years ago

Reported DNS lookup times can be inaccurate

Categories

(Core :: Networking: DNS, defect, P2)

defect

Tracking

()

RESOLVED WORKSFORME
Performance Impact medium

People

(Reporter: acreskey, Assigned: acreskey)

References

(Blocks 1 open bug)

Details

(Keywords: perf:pageload, Whiteboard: [necko-triaged])

Based on this comment, https://bugzilla.mozilla.org/show_bug.cgi?id=1596935#c21, we may be misreporting the time spent doing DNS lookup. (As reported though the Performance Timing api).

That is, the resolved address is being used in the socket process but the reported time is only calculated once the event is processed on the main thread of the parent process, possibly including a significant processing delay.

This bug is to verify and ensure that the DNS lookup time, i.e. DomainLookupEnd, reported to the Performance Timing api is as accurate as possible.

This should be the case for both OS-based DNS and DoH.

This discrepancy in reporting may be the root of Bug 1583298 and Bug 1596935.

Blocks: 1626958
See Also: 1626958
Blocks: 1583298
See Also: 1583298

Hi Greg,

Could you find someone to work on this?

Thanks.

Severity: -- → S3
Flags: needinfo?(ghess)
Priority: -- → P2
Whiteboard: [necko-triaged]

Setting perf flags, because this is a dependency for perf bug 1583298.

Performance Impact: --- → P2
Keywords: perf:pageload
Assignee: nobody → eguloien
Status: NEW → ASSIGNED
Status: ASSIGNED → NEW
Flags: needinfo?(ghess)

Ed, I'm happy to look into this one as well - let me know if you'd like to hand it off.

Feel free to take this one, Andrew. :)

Assignee: eguloien → acreskey

What I'm seeing so far is that the DNS lookup completes in the socket thread in DnsAndConnectSocket::OnLookupComplete().
We stay on the socket thread and call nsHttpTransaction::OnTransportStatus(NS_NET_STATUS_RESOLVED_HOST) and record the DomainLookupEndTime.

I have more to look at, but so far it seems that the timing is calculated without any additional delay from a main thread hop.

Hi Dragana,
I've looked into this possible inaccuracy (see Comment 1), but it looks to me that the Domain Lookup Start and Domain Lookup End times are both correct.
We call SetDomainLookupStart here on the socket thread.
And we call SetDomainLookupEndhere also on the socket thread with out additional main thread event processing.

Let me know if I'm missing anything.

Flags: needinfo?(dd.mozilla)

Thank you for investigating. This must have been fixed at some moment.

Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(dd.mozilla)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.