Skip to content

Pod quota - #143

Open
bourgeoa wants to merge 3 commits into
mainfrom
pod-quota
Open

Pod quota#143
bourgeoa wants to merge 3 commits into
mainfrom
pod-quota

Conversation

@bourgeoa

Copy link
Copy Markdown
Member

No description provided.

bourgeoa and others added 3 commits August 15, 2026 19:11
Per-write pod quota on the CSS file backend recursively walks the whole pod
per stream chunk (chunks × O(N)), causing extreme slowness and memory
exhaustion on large inboxes. This adds two pivot components wired via
config Overrides (no CSS fork):

- DuSizeReporter: SizeReporter measuring apparent bytes (du -sb / BSD
  -s -A -B 1) with a per-path TTL cache, Node-walk fallback when du is
  unavailable (Windows), and invalidate() to drop resource + ancestor
  (pod root) cache entries after writes.
- FastQuotaStrategy: extends PodQuotaStrategy; computes available space
  ONCE per write and only tracks the write's own byte delta per chunk
  (was: full pod walk per chunk).

Config: config/storage/backend/quota-fast-file.json overrides
urn:solid-server:default:SizeReporter + QuotaStrategy (70 MB, apparent
bytes, ignoreFolders ^/\.internal$, ttl 5000); imported from
customise-me.json.

Benchmark (5000 files/1KB pod, 4MB write in 64KB chunks): guard 36 279 ms
-> 3.3 ms (~11 000x); cached getSize 0.13 ms. Equivalence proof: 12/12
random trees byte-identical to FileSizeReporter (du path + Node fallback).

Includes unit tests and scripts/benchmark-quota.js +
scripts/verify-size-equivalence.js.
Moved from docs/ (which is gitignored) to the repo root so it is tracked.
Documents the problem (per-chunk pod walks), the A+B design (DuSizeReporter
+ FastQuotaStrategy), the decisions (apparent bytes, persist-per-write,
A+B first), staleness/recovery (SS4.8), and the verification section SS7
(benchmark ~11 000x guard speedup + 12/12 byte-identical equivalence).
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