Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

Answer byte ranges on raw downloads

26c9be338872126250f581f47c16ae5619f2cd2c · Keenan Nemetz · 9d ago · parent 1dfa8cbd

Answer byte ranges on raw downloads

`/r/<name>/raw/<ref>/<path>` streamed the whole blob and ignored `Range`,
so a client resuming a download or asking for a few KiB received the
whole file. The artifact route already answers `206`; this does the same
for repository content.

A blob is streamed from `git cat-file`, which cannot seek, so a range
reads and discards the bytes before it and copies only the requested
part. The win is what does not cross the network: a 64 KiB range of an
8 MiB file is still 8 MiB of reading on the server, but 64 KiB of
transfer instead of 8 MiB.

- A single `Range` is answered with `206`, `Content-Range`, and only the
  requested bytes; prefix, open-ended and suffix forms all work.
- A range that starts past the end is `416` with `Content-Range: bytes */<size>`.
- Multiple ranges, an unknown unit, and a malformed header get the whole
  file with `200`, which RFC 9110 allows.
- The no-range response keeps its bytes and gains `Accept-Ranges: bytes`.
- `HEAD` stops after the headers instead of reading the blob.

The load harness's `raw-range` scenario now reports `206`: 365.6 req/s at
concurrency 4, p50 11 ms, against 265.6 req/s and p50 15 ms when the full
file was sent.

docs/load-testing.md +3−3

@@ -74,9 +74,9 @@ and git child processes during the run.
74 74 compare changes, not a prediction of a real deployment.
75 75 - A warm cache is not simulated beyond the index build: the first run after a
76 76 restart will be slower.
77 - The `raw-range` scenario sends a `Range` header to a route that does not
78 implement it. It is there to measure that the server sends the whole file
79 anyway; the artifact route does answer `206`.
77 - The `raw-range` and `artifact-range` scenarios send a `Range` header and expect
78 `206` with only the requested bytes. Before #119 the raw route answered `200`
79 with the whole file, which is why the scenario exists.
80 80
81 81 ## Adding a scenario
82 82