|
|
@@ -172,6 +172,7 @@ docker run -d --name svapi-dev -p 8080:8080 -e SMARTBOTIC_VECTORAPI_KEY=dev svap
|
|
|
|
|
|
The snapshot serialises the whole in-memory store into one buffer, compresses into a second, writes, then verifies by reading back and fully decompressing - so the peak is roughly **working set + one serialised copy of the store**, about +400 MB there. **Compaction never raised anonymous memory at all**, even on a 626 MB env, because `mdb_env_copy2` streams the mmapped env with small buffers; its cost is reclaimable page cache. Two consequences that inverted our planning: a large ENV does not threaten memory (so dropping a big collection would not have helped), and the thing that CAN kill the boot is identical work on every attempt, so under a cap it cannot fit it **loops at the same point** rather than retrying into eventual success. Progress is not persisted per project either.
|
|
|
**Our own 1092 MiB figure was a cgroup peak and therefore INCLUDED page cache; only the anonymous part has to fit.** Quoting it as the memory requirement overstates it - the same measure-the-wrong-quantity error as reading `VmHWM` and forgetting the LMDB mmap is file-backed.
|
|
|
+ **MEASURED ON PROD, 2026-10-12: its own hourly snapshot peaks at 1051 MiB RSS against a 743 MiB steady state (+307 MB), and it survives that EVERY HOUR with vectorapi still running.** Sampled at 1 Hz across the 13:30 UTC snapshot: 761 MB steady, 950 at 13:30:19, 1034 at 13:30:20, 1051 at 13:30:23, with "Created snapshot at sequence 206689" logged at 13:30:25. Box is 1973 MB, other services ~264 MB (journald 110, qdrant 82, dockerd 54, nginx 18), so peak plus others is ~1315 MB and the margin is **~658 MB** with vectorapi stopped and the old process's memory already freed. **So the seal snapshot fits, and the strongest part of that evidence is not the arithmetic - it is that the same code path on the same store already runs hourly and survives.** It also fully explains the container OOM at a 900 MiB cap: the cgroup counted anon plus page cache, and ~724 MiB of steady-state total plus a ~307 MB snapshot spike simply exceeds 900.
|
|
|
**The safest pre-flight number is the running server's own periodic snapshot.** `snapshot_interval_sec` is 3600 on prod, so it performs this exact serialise-compress-verify hourly and survives it; sampling its RSS across one ("Created snapshot at sequence ...") gives the peak the first boot has to reproduce, on the same store, same code and same config. A number from the thing itself beats any number from a container.
|
|
|
- **A SECOND RESTART IS NOT NEEDED ON 2.17.2, measured rather than reasoned.** Our `KeyStore`/`SettingsStore` bootstraps DO perform the online upgrade after the migration, and the log says so - but with **0 rows and 0 history versions rewritten**, because the collections are already ciphertext through the bare-alias merge. `encryption-verify` then reports `sealed: yes`, `CLEAN`, exit 0. So the window is TWO steps and ONE compaction (upgrade, then start vectorapi), with verify as the branch: plain `CLEAN` means done, `CLEAN (UNSEALED: ...)` means take the reseal inside the window. On 2.17.1 that same flag move requested a reseal that compacted every project, which is where the obsolete three-step plan came from.
|
|
|
Note the upstream log line still says "old plaintext copies are removed at the next restart" even when it rewrote NOTHING, which contradicts verify's `sealed: yes` and would have an operator restart for no reason. Trust verify.
|