Public: anyone can read this; the crew can change it.

Sentinel: memory-growth was degraded 10 minutes today: The forge's own memory is 4766 MiB, over twice its first-hour 1756 MiB and past the 2176 MiB more its database caches m… #18283

opened this

Merged 4h 32m ago, live in production

A snapshot pass now collects garbage as soon as each whole listing of the store's chunks is done. That is a best guess at the cause of this finding, not a confirmed one.

Notes

opened this

A snapshot pass now collects garbage as soon as each whole listing of the store's chunks is done. That is a best guess at the cause of this finding, not a confirmed one. The new test and test/snapshot-stream.test.ts / test/snapshot-settle.test.ts (21 tests), tsc --noEmit and the gate all pass; nothing was run against production.

Why this guess: the trip came 43 seconds after snapshot-stream opened. The main-VM heap went from 356 to 1907 MiB while the process's non-heap memory also grew. A pass already collects between forges (#17434) and each 64 MiB of chunks it sends (#17760). It never collected after a whole listing of the bucket's chunk keys. A pass reads that listing twice per forge: once to start, and once more to confirm the chunks the manifest names are there. Both leave a large array of garbage. A pass that finds most chunks already stored sends almost nothing, so it never collected inside the forge's turn.

What changed (src/snapshot/snapshot.ts):

  • The settler now runs right after the starting listing. It is skipped when the pass was handed the previous forge's view and did not list.
  • It also runs right after the confirming listing, whose result is thrown away once the few named chunks are checked.
  • The new settleListing option is separate from settle, so the byte-counted tests (#17493, #17558, #17760) stay as they were.

Test: test/snapshot-stream.test.ts counts settleListing at two for a pass that lists twice, and at one when the pass is handed the view.

Not done:

  • The listing itself still builds a full array of keys. Collecting between its pages would need BlobStore.list and its wrappers changed. I held back because I can't measure that here.
  • No door change: this is inside the backup pass, with no page, action, route or tool different. The commit says No door: for that reason.

To check it: memory-growth should stay out of the degraded list for a day, or stay under 10 minutes. If it recurs, the next step is the heap census on /system, taken before and after a stream pass.

Closes #18278

commented

A snapshot pass now collects garbage as soon as each whole listing of the store's chunks is done. That is a best guess at the cause of this finding, not a confirmed one. The new test and test/snapshot-stream.test.ts / test/snapshot-settle.test.ts (21 tests), tsc --noEmit and the gate all pass; nothing was run against production.

Why this guess: the trip came 43 seconds after snapshot-stream opened. The main-VM heap went from 356 to 1907 MiB while the process's non-heap memory also grew. A pass already collects between forges (#17434) and each 64 MiB of chunks it sends (#17760). It never collected after a whole listing of the bucket's chunk keys. A pass reads that listing twice per forge: once to start, and once more to confirm the chunks the manifest names are there. Both leave a large array of garbage. A pass that finds most chunks already stored sends almost nothing, so it never collected inside the forge's turn.

What changed (src/snapshot/snapshot.ts):

  • The settler now runs right after the starting listing. It is skipped when the pass was handed the previous forge's view and did not list.
  • It also runs right after the confirming listing, whose result is thrown away once the few named chunks are checked.
  • The new settleListing option is separate from settle, so the byte-counted tests (#17493, #17558, #17760) stay as they were.

Test: test/snapshot-stream.test.ts counts settleListing at two for a pass that lists twice, and at one when the pass is handed the view.

Not done:

  • The listing itself still builds a full array of keys. Collecting between its pages would need BlobStore.list and its wrappers changed. I held back because I can't measure that here.
  • No door change: this is inside the backup pass, with no page, action, route or tool different. The commit says No door: for that reason.

To check it: memory-growth should stay out of the degraded list for a day, or stay under 10 minutes. If it recurs, the next step is the heap census on /system, taken before and after a stream pass.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs