Skip to content

storage: make archive index cache eviction policy configurable - #3586

Merged
syphar merged 1 commit into
rust-lang:mainfrom
syphar:archive-index-cache
Oct 7, 2026
Merged

syphar merged 1 commit into
rust-lang:mainfrom
syphar:archive-index-cache

Conversation

@syphar

@syphar syphar commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Next step in our optimization journey.

The 200 GiB archive-index cache is under sustained capacity pressure: over four hours, it downloaded 1.56 million indexes and evicted 1.55 million, transferring about 1.17 TiB.

Also, out of ~4.5 million archive index queries, we had to download ~1.5 million index files, which feels like much. But all of that depends on how crawlers work.

We’re trying LRU because accesses often arrive in bursts: after the first crate page, users—and crawlers—request more pages within minutes. TinyLFU can reject a newly downloaded index before those follow-up requests arrive. LRU retains it based on recency, which could reduce repeated downloads during browsing.

The tradeoff is that broad crawler scans may displace popular indexes. With stable traffic, we’ll compare download counts, downloaded bytes, and lookup errors at the same capacity to see whether LRU improves reuse.

If this doesn't help enough, we can build our own TinyLFU with a broader admission window.

@syphar syphar self-assigned this Oct 7, 2026
@github-actions github-actions Bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Oct 7, 2026
@syphar
syphar marked this pull request as ready for review October 7, 2026 08:42
@syphar
syphar requested a review from a team as a code owner October 7, 2026 08:42
@syphar
syphar merged commit 1733306 into rust-lang:main Oct 7, 2026
12 checks passed
@syphar
syphar deleted the archive-index-cache branch October 7, 2026 08:45
@github-actions github-actions Bot added S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Oct 7, 2026
@syphar syphar removed the S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it label Oct 7, 2026

This branch was successfully deployed

1 active deployment
github-pages — be2cf014 Deployed Oct 7, 2026 by syphar via deploy #626
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