fpm-tune
beta
How it decides
How it decides
A tool that writes production configuration earns trust by being legible, not by being clever. This section is the whole of what it does with a host's memory, and every non-obvious choice here was made because the obvious one is wrong in a way that only shows up under load.
Read it in order:
- The budget: where the number it divides comes from, and why reading the machine's memory is the wrong answer on a VM.
- Measuring workers: the learner: how it decides what one worker costs, why it separates "what it costs" from "may I shrink it", and why it will believe an expensive reading instantly but a cheap one only slowly.
- Spawned children: the memory a worker's own RSS does not include: the ffmpeg it shelled out to. How that is measured, why the cgroup is the ground truth where there is one, and how a workload declaration keeps a media pool safe on the run before it has been measured.
- Dividing the budget: the allocator: floors first, then demand to the pools a shortage is actually hurting, cheapest fix first; and what it does when the floors themselves do not fit.
- Hysteresis: when a change is worth a reload and when it is not, and why growing and shrinking are not held to the same caution.
- Static, dynamic, ondemand: what it does with each
pmmode, why it sizes within the mode rather than changing it, and the one suggestion it will make when a mode doesn't fit the workload.
The allocator (dividing the budget) is pure computation with no I/O and no dependencies, which is what makes it exhaustively testable. A randomised sweep over hundreds of thousands of generated plans checks the one invariant that matters: a plan never commits more memory than the budget.