Artifacts Associated With Ticket fbe8dbfcc2
Ticket change [77a8b7471e] (rid 893) by dmestas on 2026-08-18 19:56:50:
- Untracked field cmimetype: "text/x-markdown"
- comment initialized to:
Everything fleet-wide today walks every repository. At 23 stores that is invisible; it is linear, so it is a wall rather than a slope. Measured now, and the naive extrapolation to 10,000 stores: | surface | 23 repos | ~10,000 | |---|---|---| | `repo.list` | 42 ms | ~4 s | | `people.list` | 8 ms | ~6.5 s | | `search.all` | 415 ms | ~40 s | `search.all` is the worst because each repository is a separate SQLite file and a separate FTS query. It is also the one with a hard resource floor: 10,000 open database handles. ## What has to change 1. **Paging, everywhere.** `repo.list` returns every repository and the landing page renders all of them. It needs a cursor and a page size, and the fleet SSE stream has to page with it or a repaint re-sends the whole listing. 2. **Never open every index to answer a fleet question.** `people.list` and the tab counts should read a fleet-level rollup in the forge OLTP, refreshed on ingest, rather than fanning out per request. The per-repo `contributor` table is already the right shape to roll up from. 3. **Search needs a different mechanism, not a bigger fan-out.** Fan-out was the honest choice at this size and it stays correct, but past roughly 500–1,000 stores it has to become one shared index. That is the point at which the contentless-FTS work becomes worth doing too, since the shared index is where the duplicated `search_doc` text would otherwise be paid for again. 4. **Bound the handles.** An index handle per served repository is a file descriptor per repository held open forever. That needs an LRU of open indexes with the rest closed. ## Order Paging first — it is the only one a reader notices immediately, and it is contained. The rollup second. The shared search index last, because it is the one that changes the architecture rather than the queries, and it should be done with a real corpus to measure against rather than speculatively.
- severity initialized to: "Important"
- status initialized to: "Open"
- title initialized to:
Fleet surfaces are O(repos) and will not survive thousands of stores
- type initialized to: "Code_Defect"
Ticket change [9dd65c53c0] (rid 1066) by dmestas on 2026-08-19 11:04:29:
- priority changed to: "Medium"
- type changed to: "Code_Defect"
Ticket change [8285058936] (rid 1117) by dmestas on 2026-08-19 12:10:44:
- subsystem changed to: "web"
Ticket change [fbc148010a] (rid 7395) by zeitgeist on 2026-09-12 15:57:54:
- icomment:
Re-read 2026-09-12. The analysis still holds: repo.list takes a Limit but has no cursor and still walks every store to build the list before capping it, and people.list still fans out over Repos.Names(). Three things have changed around it, though. 1. Item 1's mechanism now exists as a worked example. The forum thread list was the same shape of wall — it rendered every thread — and now pages with a keyset cursor (activity DESC, root ASC) plus a separate count query for the total, one row over the page so 'is there a next page' is answered by what came back. Measured on fossil's forum: 26,736 KB and 264 ms became 393 KB and 55 ms. Worth copying rather than re-deriving for repo.list. Note the measurement surprise: the two SQL queries cost 72 ms together, so the wall was MARKUP (222,884 rect elements from per-thread sparklines and identicons), not the query. Any paging work here should measure which half it is before optimising. 2. Item 4 got its precondition. Index.Close() now waits for the rewarms it started instead of closing the database underneath them — an LRU of open indexes has to be able to close one while background work is in flight, and until now that was a use-after-close. 3. One cost went UP, which the ticket should know: search.all now also searches a bound forum companion (RFC 0015), so the fan-out is one extra index per bound pair, not per repository. Companion stores are otherwise filtered out of the dashboard listing and folded into their parent's facet, so a bound pair is one project to a reader and two indexes to the fan-out. The 23-store measurements in the table are also now stale in composition rather than in kind: pkgsrc was added (218,590 records, 1.1 GB of index) and it is the store that would dominate any per-repo fan-out timing.
- mimetype: "text/x-markdown"
- icomment:
Ticket change [be5e7068dc] (rid 12461) by zeitgeist on 2026-09-24 00:52:53:
- Untracked field number: "26"