Skip to content

perf(cache): fan out large ranged reads through the remote tier#389

Draft
worstell wants to merge 1 commit into
mainfrom
worstell/remote-ranged-fanout
Draft

perf(cache): fan out large ranged reads through the remote tier#389
worstell wants to merge 1 commit into
mainfrom
worstell/remote-ranged-fanout

Conversation

@worstell

Copy link
Copy Markdown
Contributor

Generalizes the S3-only window adapter from the large-range work into objectWindow, a byte window over any pinned object revision, and uses it to extend the large-range policy to the remote HTTP tier.

  • Refactor: s3ObjectWindow becomes the generic objectWindow (range resolution, header synthesis, and offset translation), parameterized by an openRange function so S3 keeps issuing direct sub-range GETs with no behavior change. newCacheObjectWindow builds a window over any Range-capable cache via ETag-pinned conditional Opens.
  • Perf: Remote.Open splits ranged reads of ≥ 8 MiB into parallel 4 MiB sub-range requests (concurrency 8) pinned with If-Match, mirroring how the S3 backend fans out internally. One preliminary Stat resolves the request's conditionals and range against the object's real size and revision; small explicit ranges skip the Stat entirely, and anything the policy cannot pin or split (no ETag, If-Range miss, sub-threshold after clamping) delegates to the existing single stream.

Chunks stay below the remote's own S3 large-range threshold, so a sub-range arriving at a remote cachew backed by S3 maps to a single upstream request rather than fanning out twice. Memory per read is bounded by the reader's reorder window (2 × concurrency × chunk size = 64 MiB).

A tiered cache with a remote tier inherits the fan-out with no changes to Tiered itself, so disk-tier ranged reads are untouched.

Generalize the S3 object-window adapter into objectWindow, a byte window
over any pinned object revision, and use it to apply the large-range
policy to Remote ranged reads: ranges of 8 MiB or more pay one Stat to
learn the object's size and ETag, then split into parallel 4 MiB
sub-range requests pinned with If-Match. Chunks stay below the remote's
own S3 fan-out threshold so sub-ranges never fan out twice, and memory
is bounded by the reader's reorder window (2*concurrency*chunkSize).
Ranges the policy cannot pin or split delegate to a single stream.
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.

1 participant