hostcapacity

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package hostcapacity derives how many workers of a class a host can run at once, from what the host configuration already declares.

The fleet asserts one job per host in nine places across two components, and that number was read as a pilot constant to be raised later. It is not. For the heavy classes it is what the declared Incus project caps already imply: a four-vCPU worker against project_max_cpu_units: 6 admits one, and a 10240 MiB worker against project_max_memory_mib: 12288 admits one. The fast class, at two vCPU and 4096 MiB, admits three -- which is exactly the max_running: 3 gha-runner-3 already declares.

So the constant is not wrong, it is merely unexplained, and unexplained is what makes it look raiseable. Deriving it says what would actually have to change: on the current hardware, a second concurrent integration worker needs 20480 MiB where the host has 15991, so it needs another host rather than a larger number.

Index

Constants

View Source
const (
	BindingInstances = "incus.project_max_instances"
	BindingCPU       = "incus.project_max_cpu_units"
	BindingMemory    = "incus.project_max_memory_mib"
)

Bindings, in the order they are tested.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limit

type Limit struct {
	Pool string
	// Workers is the number of workers of this pool that fit at once.
	Workers int
	// Binding names the cap that produced Workers. It is reported because "one"
	// is a very different fact depending on whether the instance ceiling, the
	// CPU units or the memory decided it.
	Binding string
}

Limit is the concurrency a pool can reach and the constraint that decides it.

func ForHost

func ForHost(cfg fleetconfig.Config) ([]Limit, error)

ForHost derives every declared pool's concurrency.

func ForPool

func ForPool(cfg fleetconfig.Config, pool string) (Limit, error)

ForPool derives the concurrency one pool can reach on the host the configuration describes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL