Improve DNS cache eviction strategy
Categories
(Core :: Networking, enhancement, P2)
Tracking
()
People
(Reporter: valentin, Assigned: kershaw)
References
(Regressed 1 open bug)
Details
(Whiteboard: [necko-triaged][necko-priority-review])
Attachments
(1 file)
mozilla::net::HostRecordQueue::AddToEvictionQ adds entries to the evictionQ, and those entries get evicted when the queue is full.
We may remove it from the queue when mozilla::net::HostRecordQueue::MaybeRenewHostRecord gets called, which would cause it to be added back, but otherwise it's a FIFO eviction strategy.
Potential improvements:
- When a DNS cache entry is used, take it out and readd it to the eviction queue (ie switch to a least-recently-used eviction strategy)
- When an eviction happens, evict expired resources first considering their TTL.
If I understand correctly, we currently set a limit of 800 entries. Under the assumption, that each entry is < 1_000 bytes, this limit seems small.
@Valentin, would a third "potential improvement", namely increasing this limit be worth exploring as well?
Comment 2•26 days ago
|
||
FYI the current limit of 800 was already doubled from 400 as part of the dns caching experiments in Bug 1950852. We didn't see any side effects there, but also no benefits (at least not through the telemetry noise).
Also for reference there is the old Bug 1463374 which was basically addressing the same thing and if I remember correctly from looking at it last year the suggested changes were also a combination of Valentin's recommendation, i.e. least-recently-used + evict expired first.
| Reporter | ||
Comment 3•18 days ago
|
||
Increasing the limit even higher probably wouldn't hurt, but the switch to LRU is much more impactful.
| Assignee | ||
Comment 4•4 days ago
|
||
Updated•4 days ago
|
Comment 6•22 hours ago
|
||
| bugherder | ||
Comment 8•17 hours ago
|
||
Backed out of central: https://hg.mozilla.org/mozilla-central/rev/7c6e6dc03dc0fd5049e5cba70fcf669cb2e772d7
Description
•