Aggie Student Toolkit — Load Balancer CSCE 412 Project 4
Arnav Fotedar · Fall 2026 · C++ load balancer simulation
Loading...
Searching...
No Matches
ScalingPolicy Struct Reference

Rules for growing and shrinking the server pool. More...

#include <LoadBalancer.h>

Public Attributes

double upperFactor = 80.0
 Scale up when queue > upperFactor x active servers.
double lowerFactor = 50.0
 Scale down when queue < lowerFactor x active servers.
unsigned int cooldownCycles = 10
 Cycles between scaling evaluations.
unsigned int minServers = 1
 Never fewer active servers than this.
unsigned int maxServers = 100
 Never more live servers (active + retiring) than this.

Detailed Description

Rules for growing and shrinking the server pool.

With Q = pending queue size and S = active (non-retiring) servers, the load balancer adds a server when Q > upperFactor x S and removes one when Q < lowerFactor x S. It evaluates the rule once every cooldownCycles cycles and changes the pool by at most one server per evaluation.

Definition at line 29 of file LoadBalancer.h.

Member Data Documentation

◆ upperFactor

double ScalingPolicy::upperFactor = 80.0

Scale up when queue > upperFactor x active servers.

Definition at line 30 of file LoadBalancer.h.

◆ lowerFactor

double ScalingPolicy::lowerFactor = 50.0

Scale down when queue < lowerFactor x active servers.

Definition at line 31 of file LoadBalancer.h.

◆ cooldownCycles

unsigned int ScalingPolicy::cooldownCycles = 10

Cycles between scaling evaluations.

Definition at line 32 of file LoadBalancer.h.

◆ minServers

unsigned int ScalingPolicy::minServers = 1

Never fewer active servers than this.

Definition at line 33 of file LoadBalancer.h.

◆ maxServers

unsigned int ScalingPolicy::maxServers = 100

Never more live servers (active + retiring) than this.

Definition at line 34 of file LoadBalancer.h.


The documentation for this struct was generated from the following file: