Skip to content

LXC AutoScale MLAutomatic resource scaling for Proxmox LXC containers

Collects per-container metrics, learns what normal looks like, and adjusts CPU and memory through the Proxmox CLI

LXC AutoScale ML

Quick start

Install on your Proxmox host:

bash
curl -sSL https://raw.githubusercontent.com/fabriziosalmi/proxmox-lxc-autoscale-ml/main/install.sh | bash

Check the three services:

bash
systemctl status lxc_autoscale_api lxc_monitor lxc_autoscale_ml

Before letting it act on anything, set dry_run: true in /etc/lxc_autoscale_ml/lxc_autoscale_ml.yaml and read the log for a few cycles. It will report the decisions it would have taken without calling the API.

Requirements

RequirementVersion
Proxmox VE8.x (Debian 12). Developed and tested there.
Python3.10 to 3.12
Operating systemDebian-based Linux

Proxmox VE 9 ships Python 3.13, which the pinned numpy, pandas and scikit-learn do not yet support. The API and the monitor run there; the model does not.

How it works

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│   Monitor   │────▶│    Model    │────▶│     API     │
│  (Metrics)  │     │ (ML Engine) │     │  (Actions)  │
└─────────────┘     └─────────────┘     └─────────────┘
       │                   │                   │
       ▼                   ▼                   ▼
  Collect CPU,       Train model,        Apply scaling
  RAM, disk,         detect anomalies,   decisions to
  network stats      predict needs       containers
  1. Monitor reads CPU, memory, I/O, network and filesystem figures from every running container and appends them to a JSON file.
  2. Model trains an IsolationForest on that history, compares the latest sample against configured thresholds, and decides whether to scale.
  3. API carries the decision out by running pct on the host.

The three run as separate systemd services and only share the metrics file.

Status

See the changelog. v1.3.0 fixed three defects that each broke the scaling loop end to end, so versions before it did not autoscale. If you are running one, upgrade.

License

Released under the MIT License.

Released under the MIT License. · Privacy & legal