Skip to main content

Module soak

Module soak 

Source
Expand description

Proving nothing grows without bound.

This is the failure that only appears in production, because it is the only one that needs hours to become visible. A stack that leaks a task per call is indistinguishable from a correct one for the length of any test somebody runs impatiently.

Flat, not merely bounded. A leak that fills a pool is still a leak; the pool only hides it until it becomes a problem, and then hides the cause too. So the assertion is that the reading at the end matches the reading at the start, within a tolerance for the noise a runtime genuinely has — not that it stayed under some ceiling.

Measured after settling, and the settling period is longer than it looks. Ending a call is not instantaneous, and the slow part is not teardown — it is the protocol. RFC 3261 §17 keeps a completed server transaction alive for Timer J, 64·T1, thirty-two seconds, so it can absorb a retransmitted request. For that whole time there is a task per call that has ended, and it is doing exactly what the RFC requires.

So a settle shorter than the longest transaction timer reports the specification as a leak. The first version of sipx’s own soak used five seconds and duly failed with “tasks grew from 5 to 305” after 300 calls — a number that looks exactly like a one-task-per-call leak and was not one. SETTLE_PAST_TIMERS is the floor.

Structs§

Reading
A reading of the things that must not grow.
Soak
What a soak run found.
Tolerance
How much drift is noise rather than a leak.

Constants§

SETTLE_PAST_TIMERS
The shortest settling period that does not accuse the protocol of leaking.

Functions§

alive_tasks
The number of tasks alive in the current runtime.
open_descriptors
How many file descriptors this process holds.
resident_kb
Resident memory in kilobytes.
sample
Take a reading of the process now.
soak
Run load, then wait for things to settle, and report what grew.