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

Optimize presigning for replay.json #2516

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Conversation

ikreymer
Copy link
Member

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.

Testing:

  1. Call clear presigned API endpoint to clear presigned.
  2. Test by loading crawl or collection with large number of files (eg. Vice crawl).
  3. Repeat with this branch and current main
  4. Collection and crawls should load an order of magnitude faster with this approach.

@ikreymer ikreymer requested a review from tw4l March 25, 2025 07:31
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.

[Feature]: Optimize replay.json generation + presigning
1 participant