Sign in

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

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Restructure documentation around reader tasks

348a43c364fbb04be834af44a7cd43a0931fa280 · Keenan Nemetz · 20d ago · parent b7383c19

Restructure documentation around reader tasks

Group the site by getting started, collaboration, CI, publishing, and administration. Rewrite the guides as executable procedures and move issue formats, merge semantics, configuration defaults, customization, and access-control mechanics into dedicated references.

Verify the quickstart and review flow against a throwaway instance, execute the service recipe, inspect the rendered site, and run the complete verify workflow.

Closes: 01M7B6X6RDYBAP3JVA5SYSA1K8

docs/load-testing.md +76−76

@@ -1,96 +1,96 @@
1 1 # Load testing
2 2
3 Vole ships a load harness that drives a real instance on a loopback port with a
4 temporary data directory. It runs the same server code an operator runs, behind
5 the `load` build tag so `go test ./...` and the verify workflow never execute it.
3 Vole's load harness starts a real server on loopback with temporary state and
4 drives selected routes concurrently. Use it to compare a change or find a route's
5 limit; do not treat loopback results as production capacity predictions.
6 6
7 Use it to answer a question with a number: did this change make a route faster,
8 and where does it stop? The limits in [Configuration](configuration.md) were
9 chosen from reasoning first; a run here is what replaces that with measurement.
7 The harness is excluded from ordinary tests by the `load` build tag. You need a
8 Vole source checkout, Go, a C compiler, and the SQLite requirements in
9 [Build from source](install.md#build-from-source).
10 10
11 ## One command
11 ## Run a scenario
12 12
13 Every route:
13 Measure every route for five seconds with four workers:
14 14
15 15 ```sh
16 16 VOLE_LOAD_SCENARIO=all VOLE_LOAD_CONCURRENCY=4 VOLE_LOAD_DURATION=5s \
17 17 go test -tags load,sqlite_fts5 -run '^TestLoad$' -v ./server
18 18 ```
19 19
20 One route, or clones past the limit:
20 Measure clones with sixteen workers for thirty seconds:
21 21
22 22 ```sh
23 23 VOLE_LOAD_SCENARIO=clone VOLE_LOAD_CONCURRENCY=16 VOLE_LOAD_DURATION=30s \
24 24 go test -tags load,sqlite_fts5 -run '^TestLoad$' -v ./server
25 25 ```
26 26
27 The build needs `sqlite_fts5` beside `libsqlite3` (see
28 [Install § Build from source](install.md#build-from-source)); `-tags load` on the
29 command line replaces `GOFLAGS`, so both belong on it.
27 `sqlite_fts5` enables search support. Add `libsqlite3` to the comma-separated tag
28 list when building against system SQLite; without it, the driver uses its bundled
29 copy. Put every required tag on the command line because `-tags` replaces tag
30 settings inherited through `GOFLAGS`.
30 31
31 ## Knobs
32 ## Settings
32 33
33 | Variable | Default | What it does |
34 | Variable | Default | Values |
34 35 |---|---|---|
35 | `VOLE_LOAD_SCENARIO` | `clone` | `all`, or one of `clone`, `clone-large`, `blob-small`, `blob-limit`, `raw-small`, `raw-limit`, `raw-range`, `overview`, `tree`, `commits`, `compare`, `change`, `issue`, `activity`, `instance-activity`, `home`, `search-code`, `search-find`, `artifact`, `artifact-range`, `site`, `comment`. |
36 | `VOLE_LOAD_CONCURRENCY` | `4` | Workers driving the scenario in parallel. |
37 | `VOLE_LOAD_DURATION` | `10s` | How long the workers keep going. |
38
39 ## What it seeds
40
41 Three repositories and a site:
42
43 - `demo`: 300 commits; files at several sizes including one at the configured
44 `max_blob_bytes` (the harness sets 8 MiB, so the file is one a push could
45 deliver); an issue with five comments; a change request whose branch carries a
46 4000-line diff, with five review comments and an approval by a second account;
47 a release tag with one artifact in the LFS store; and a `pages` branch served
48 at `demo.pages.test`.
49 - `small`: 50 commits and small files, so a clone is quick.
50 - `large`: 3000 commits and one 16 MiB incompressible blob, so a clone is not.
51
52 `demo` and `large` are read once before the run so their indexes are built
53 outside the measurement.
54
55 The clone scenario gives every worker a distinct `X-Forwarded-For` address (the
56 fixture trusts the header on loopback), so the global `git_http_max_concurrent`
57 is the limit that refuses rather than the per-client one. At the configured
58 `git_http_max_concurrent` the run stays at `200`; above it, refusals arrive as
59 `503` with `Retry-After`, and a clone caught by one reports the curl failure.
60
61 ## The one scenario that writes
62
63 Every scenario above reads. `comment` posts a comment as the fixture's writer
64 account, which is one commit on the metadata branch that every write in the instance
65 shares: the issue, the change request, the approval, and the release pointer all move
66 the same ref. It is the scenario to run after touching the write path, and the one
67 where throughput should stay flat as workers are added while latency grows with the
68 queue behind it — a rising error count or a falling throughput means writers are
69 fighting over the branch instead of taking turns.
70
71 ## What it reports
72
73 Per scenario: requests and throughput, latency at p50/p90/p99, HTTP statuses,
74 failure reasons, and the peak of process RSS, open file descriptors, goroutines,
75 and git child processes during the run.
76
77 ## What it does not tell you
78
79 - The server runs inside the test process, so RSS and goroutines include the
80 harness and its clients.
81 - Child processes are counted by name (`http-backend`, `upload-pack`,
82 `receive-pack`). The harness's own `git clone` processes are excluded.
83 - Loopback has no network cost and no TLS. The numbers are a floor and a way to
84 compare changes, not a prediction of a real deployment.
85 - A warm cache is not simulated beyond the index build: the first run after a
86 restart will be slower.
87 - The `raw-range` and `artifact-range` scenarios send a `Range` header and expect
88 `206` with only the requested bytes. Before #119 the raw route answered `200`
89 with the whole file, which is why the scenario exists.
90
91 ## Adding a scenario
92
93 A scenario is a step function and a deadline: each worker calls the step in a
94 loop until `VOLE_LOAD_DURATION` expires, and the step reports the HTTP status it
95 saw and any failure. The seeding, sampling and reporting in
96 `server/load_test.go` are shared, so a new route is a `case` and a function.
36 | `VOLE_LOAD_SCENARIO` | `clone` | `all` or one scenario name below |
37 | `VOLE_LOAD_CONCURRENCY` | `4` | Number of parallel workers |
38 | `VOLE_LOAD_DURATION` | `10s` | Duration each worker keeps issuing requests |
39
40 Scenario names:
41
42 ```text
43 clone clone-large blob-small blob-limit
44 raw-small raw-limit raw-range overview
45 tree commits compare change
46 issue activity instance-activity home
47 search-code search-find artifact artifact-range
48 site comment
49 ```
50
51 `comment` is the only write scenario. It exercises serialized metadata-branch
52 updates; use it after changing issue, review, or other metadata write paths.
53
54 ## Fixtures
55
56 The harness seeds:
57
58 - `demo`: 300 commits, files at several sizes, an issue with five comments, a
59 change with a 4000-line diff and review records, a release artifact, and a
60 `pages` site;
61 - `small`: 50 commits and small files for quick clones;
62 - `large`: 3000 commits and one 16 MiB incompressible blob.
63
64 It builds the `demo` and `large` indexes before measurement. Clone workers use
65 distinct forwarded client addresses so the global HTTP concurrency limit, rather
66 than the per-client limit, is the one under test. Requests beyond the configured
67 limit should produce `503` with `Retry-After`.
68
69 ## Read the results
70
71 Each scenario reports request count, throughput, p50/p90/p99 latency, HTTP
72 statuses, failures, and peaks for process RSS, file descriptors, goroutines, and
73 Git child processes.
74
75 Interpret the measurements with these limits:
76
77 - RSS and goroutines include the in-process harness and clients.
78 - Loopback excludes network latency and TLS cost.
79 - The warm-up covers index construction, not every application cache.
80 - Range scenarios expect `206` and only the requested bytes.
81 - Throughput for the serialized `comment` scenario should remain bounded as
82 concurrency rises; investigate rising errors or collapsing throughput.
83
84 ## Add a scenario
85
86 Scenarios live in `server/load_test.go`. Add a scenario name and step function;
87 workers call that function until the duration expires. The file provides shared
88 fixtures, resource sampling, and reporting.
89
90 ## Next
91
92 - [Configuration](configuration.md#set-resource-limits) — adjust limits from
93 measurements.
94 - [Operations](operations.md#production-baseline) — review production resource
95 and trust controls.
96 - `DEVELOPMENT.md` in the source repository — run ordinary tests and checks.