Automatic horizontal scaling on Stack Harbor PaaS adjusts the number of containers inside a layer in response to load. You define tunable triggers; the platform analyses average consumption every minute and adds or removes nodes when the conditions are met. All instances within the same layer are placed on different hardware hosts under anti-affinity rules — a new node lands on the host with the fewest existing same-layer instances and the lowest current load.
The metric for a trigger is the layer-wide average over the trigger’s evaluation window — a three-node layer at 20%, 50%, and 20% has an average of 30%. The scale-out and scale-in conditions are independent: the window for one is not reset when the other fires.
Configure a trigger
- Click Settings on the environment.
- Open Monitoring > Auto Horizontal Scaling. The page lists existing triggers and gives you Add, Edit, Remove, and Refresh actions. Click Add.
- Pick the layer from the drop-down, then choose the resource type to monitor (CPU, Memory, Network, Disk I/O, Disk IOPS). The graph on the right shows recent consumption — use it to pick sensible thresholds. Hover the graph to read the exact value at a point in time. The graph supports up to one week of data and has an Auto Refresh toggle.
- Enable the Add Nodes and Remove Nodes conditions independently using the checkboxes on each title. The fields you set are:
- When loading is more (less) than — the upper or lower limit, in percent. You can also drag the slider on the graph. Setting 100% disables the Add Nodes trigger; setting 0% disables Remove Nodes. The minimum gap allowed between the two thresholds is 20%. Network triggers can be set in Mbps instead of percent.
- For at least — the window over which the average is calculated, from 1 to 60 minutes in 5-minute steps.
- Scale out (in) to — the maximum (or minimum) node count the trigger is allowed to reach.
- Scale by — how many nodes to add or remove on each trigger firing.
- Leave Send Email Notifications on if you want to be notified when a trigger fires. Apply.
A useful rule of thumb: pick the Add Nodes threshold above 50% to avoid scaling on noise, and make sure the gap between Add and Remove is wide enough to prevent flapping. If your layer runs in stateful mode, set Add Nodes lower than you would in stateless mode — cloning the master file system takes time, and you do not want to hit your resource limit before the new node is ready.
A handy detail for application-server layers: the first time you scale out an environment that has no load balancer, the platform automatically adds an NGINX balancer. If you need a different balancer in front of your app, add it manually before the first scaling event.
Inspect what fired and when
Triggers leave an audit trail. Under Settings > Monitoring > Events History, pick Horizontal Scaling from the Type drop-down and set the From / To range. Each row shows:
- Date and time of the trigger execution
- Action performed (Add Nodes or Remove Nodes)
- The node type the action applied to
- The condition that triggered the action
Hover a row to see the Loading Value at the moment of execution and the resulting Node Count. Because the two conditions run independently, you will sometimes see a Remove Nodes evaluation completing shortly after an Add Nodes fired — that is intentional; the platform is checking whether load actually settled.
Related pages
- Horizontal scaling — manual node addition and removal, scaling modes.
- Automatic vertical scaling — automatic adjustment of cloudlets (RAM and CPU) inside a single container.
- Statistics monitoring and load alerts — how the platform exposes the underlying metrics that triggers consume.