Documentation
¶
Overview ¶
Package dockermem measures what the Docker VM actually has and uses.
Declared limits are useless for this: one my-app stack declares more than 13 GB of mem_limit across its services yet runs in about 2 GB, because mem_limit is a ceiling and not a reservation. Only measurement tells you whether one more stack fits.
Index ¶
Constants ¶
const WarnRatio = 0.85
WarnRatio is the share of the Docker VM above which starting one more stack is worth a warning.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Usage ¶
type Usage struct {
Total int64 // bytes available to the VM
Used int64 // bytes used by every running container
// StackUsed excludes one-off `compose run` containers: a migration
// container peaking at 6 GB is not what a stack costs, and counting it
// would triple the estimate.
StackUsed int64
Projects int // distinct compose projects, one-offs excluded
}
func (Usage) PerProject ¶
PerProject is the average cost of a running stack, the best available estimate of what one more would cost.