|
Aggie Student Toolkit — Load Balancer CSCE 412 Project 4
Arnav Fotedar · Fall 2026 · C++ load balancer simulation
|
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. | |
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.
| double ScalingPolicy::upperFactor = 80.0 |
Scale up when queue > upperFactor x active servers.
Definition at line 30 of file LoadBalancer.h.
| double ScalingPolicy::lowerFactor = 50.0 |
Scale down when queue < lowerFactor x active servers.
Definition at line 31 of file LoadBalancer.h.
| unsigned int ScalingPolicy::cooldownCycles = 10 |
Cycles between scaling evaluations.
Definition at line 32 of file LoadBalancer.h.
| unsigned int ScalingPolicy::minServers = 1 |
Never fewer active servers than this.
Definition at line 33 of file LoadBalancer.h.
| unsigned int ScalingPolicy::maxServers = 100 |
Never more live servers (active + retiring) than this.
Definition at line 34 of file LoadBalancer.h.