Skip to content

Tiers

Tiers allow you to apply different scaling rules to groups of containers. Each tier overrides the global DEFAULT settings for its assigned containers.

Defining a tier

Add a TIER_<name> section to the YAML config file, listing the container IDs and the desired thresholds:

yaml
TIER_webservers:
  lxc_containers:
    - "102"
    - "103"
  cpu_upper_threshold: 70
  cpu_lower_threshold: 20
  memory_upper_threshold: 80
  memory_lower_threshold: 20
  min_cores: 2
  max_cores: 8
  min_memory: 4096
  core_min_increment: 1
  core_max_increment: 2
  memory_min_increment: 1024
  min_decrease_chunk: 1024

How tiers work

  • On each polling cycle, the daemon looks up each container's tier configuration from LXC_TIER_ASSOCIATIONS.
  • If a container is listed in a TIER_* section, that tier's settings are used.
  • If no tier is found, the DEFAULT settings apply.
  • A container can only belong to one tier.

Available tier settings

All settings from the Configuration page can be overridden per tier:

SettingDescription
cpu_upper_thresholdScale up CPU when usage exceeds this %.
cpu_lower_thresholdScale down CPU when usage drops below this %.
memory_upper_thresholdScale up memory when usage exceeds this %.
memory_lower_thresholdScale down memory when usage drops below this %.
min_cores / max_coresBounds on CPU core allocation.
min_memoryMinimum memory in MB.
core_min_increment / core_max_incrementCores added per scale-up step.
memory_min_incrementMB added per memory scale-up step.
min_decrease_chunkMB removed per memory scale-down step.
cpu_pinningPin containers to specific CPU cores. See CPU Core Pinning.

Example: multi-tier setup

yaml
DEFAULT:
  cpu_upper_threshold: 80
  cpu_lower_threshold: 20
  min_cores: 1
  max_cores: 4
  min_memory: 256

TIER_databases:
  lxc_containers:
    - "100"
    - "101"
  cpu_upper_threshold: 70
  min_cores: 2
  max_cores: 8
  min_memory: 4096

TIER_lightweight:
  lxc_containers:
    - "110"
    - "111"
  cpu_upper_threshold: 90
  max_cores: 2
  min_memory: 128

TIP

For ready-to-use tier configurations, check the Tier Snippets with 40 presets for popular self-hosted applications.

Released under the MIT License.