Skip to content

[Feature]: Optimize replay.json generation + presigning #2515

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

Closed
ikreymer opened this issue Mar 25, 2025 · 0 comments · Fixed by #2516
Closed

[Feature]: Optimize replay.json generation + presigning #2515

ikreymer opened this issue Mar 25, 2025 · 0 comments · Fixed by #2516
Assignees
Labels
enhancement Requests a change to a feature

Comments

@ikreymer
Copy link
Member

What change would you like to see?

The replay.json for crawls and collections should be optimized to look up and presign bucket paths in bulk.

Context

Loading a crawl or collection with large number of WACZ files can be slow initially, since each file's path is looked up in the presign collection, and then if needed, each file is signed individually. This results in collections with hundereds of WACZ files to be slow on first load.

This can definitely be improved with batching querying and batch presigning.

@ikreymer ikreymer added the enhancement Requests a change to a feature label Mar 25, 2025
@ikreymer ikreymer self-assigned this Mar 25, 2025
@ikreymer ikreymer moved this from Triage to Todo in Webrecorder Projects Mar 25, 2025
ikreymer added a commit that referenced this issue May 20, 2025
Fixes #2515.

This PR introduces a significantly optimized logic for presigning URLs
for crawls and collections.
- For collections, the files needed from all crawls are looked up, and
then the 'presign_urls' table is merged in one pass, resulting in a
unified iterator containing files and presign urls for those files.
- For crawls, the presign URLs are also looked up once, and the same
iterator is used for a single crawl with passed in list of CrawlFiles
- URLs that are already signed are added to the return list.
- For any remaining URLs to be signed, a bulk presigning function is
added, which shares an HTTP connection and signing 8 files in parallels
(customizable via helm chart, though may not be needed). This function
is used to call the presigning API in parallel.
@github-project-automation github-project-automation bot moved this from Todo to Done! in Webrecorder Projects May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Requests a change to a feature
Projects
Status: Done!
Development

Successfully merging a pull request may close this issue.

1 participant