Documentation
¶
Overview ¶
Package dockermem measures the memory a stack has to fit into, and what is already in it. mem_limit is a ceiling and not a reservation, so a stack declaring 13 GB across its services can run in 2 GB. See Usage.Shared.
Index ¶
Constants ¶
const WarnRatio = 0.85
WarnRatio is the share of the available memory 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 the containers have to fit into
Used int64 // bytes already used, by the containers alone unless Shared
// 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
// docker: Used is then what the whole machine uses, since a desktop holding
// 6 GB is pressure the containers compete with but cannot see.
Shared bool
}
func (Usage) PerProject ¶
PerProject is the average cost of a running stack, the best available estimate of what one more would cost.