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

Every user-adjustable setting for one simulation run. More...

#include <Config.h>

Public Attributes

unsigned int servers = 20
 Initial number of web servers.
unsigned long cycles = 100000
 Clock cycles to simulate.
unsigned int minTask = 10
 Shortest task time, in cycles.
unsigned int maxTask = 100
 Longest task time, in cycles.
double arrivalRate = 0.45
 Average new requests per cycle.
double waveAmplitude = 0.6
 Traffic wave size, 0 (steady) to 1.
unsigned long wavePeriod = 0
 Cycles per traffic wave; 0 disables the wave.
bool autoWavePeriod = true
 Use cycles / 4 (four busy/quiet waves) unless –wave-period is given.
double streamingShare = 0.35
 Fraction of requests that are streaming ('S') jobs.
unsigned int queuePerServer = 100
 Initial queue size = servers x queuePerServer.
double upperFactor = 80.0
 Scale up when queue > upperFactor x servers.
double lowerFactor = 50.0
 Scale down when queue < lowerFactor x servers.
unsigned int cooldown = 10
 Cycles between scaling checks.
unsigned int minServers = 1
 Lower bound on active servers.
unsigned int maxServers = 100
 Upper bound on live servers.
std::size_t maxQueue = 0
 Queue capacity; 0 means unlimited.
std::uint32_t seed = 412
 Random seed (logged so a run can be repeated).
std::vector< std::string > blockedRanges {"45.0.0.0/8", "103.0.0.0/8"}
 Firewall CIDR ranges.
bool verbose = false
 Print every event instead of only status lines.
bool color = true
 Use ANSI colors on a terminal.
bool useSwitch = false
 Bonus: route P and S jobs to two load balancers.
bool interactive = false
 Ask for the main settings on standard input.
bool showHelp = false
 Print usage and exit.
unsigned long statusEvery = 0
 Cycles between status lines; 0 chooses automatically.
std::string logPath
 File for the run summary (and events in verbose mode).

Detailed Description

Every user-adjustable setting for one simulation run.

Values come from command-line options, interactive prompts, or both. The defaults reproduce the required 20-server, 100,000-cycle run.

Definition at line 21 of file Config.h.

Member Data Documentation

◆ servers

unsigned int Config::servers = 20

Initial number of web servers.

Definition at line 22 of file Config.h.

◆ cycles

unsigned long Config::cycles = 100000

Clock cycles to simulate.

Definition at line 23 of file Config.h.

◆ minTask

unsigned int Config::minTask = 10

Shortest task time, in cycles.

Definition at line 24 of file Config.h.

◆ maxTask

unsigned int Config::maxTask = 100

Longest task time, in cycles.

Definition at line 25 of file Config.h.

◆ arrivalRate

double Config::arrivalRate = 0.45

Average new requests per cycle.

Definition at line 26 of file Config.h.

◆ waveAmplitude

double Config::waveAmplitude = 0.6

Traffic wave size, 0 (steady) to 1.

Definition at line 27 of file Config.h.

◆ wavePeriod

unsigned long Config::wavePeriod = 0

Cycles per traffic wave; 0 disables the wave.

Definition at line 28 of file Config.h.

◆ autoWavePeriod

bool Config::autoWavePeriod = true

Use cycles / 4 (four busy/quiet waves) unless –wave-period is given.

Definition at line 29 of file Config.h.

◆ streamingShare

double Config::streamingShare = 0.35

Fraction of requests that are streaming ('S') jobs.

Definition at line 30 of file Config.h.

◆ queuePerServer

unsigned int Config::queuePerServer = 100

Initial queue size = servers x queuePerServer.

Definition at line 31 of file Config.h.

◆ upperFactor

double Config::upperFactor = 80.0

Scale up when queue > upperFactor x servers.

Definition at line 32 of file Config.h.

◆ lowerFactor

double Config::lowerFactor = 50.0

Scale down when queue < lowerFactor x servers.

Definition at line 33 of file Config.h.

◆ cooldown

unsigned int Config::cooldown = 10

Cycles between scaling checks.

Definition at line 34 of file Config.h.

◆ minServers

unsigned int Config::minServers = 1

Lower bound on active servers.

Definition at line 35 of file Config.h.

◆ maxServers

unsigned int Config::maxServers = 100

Upper bound on live servers.

Definition at line 36 of file Config.h.

◆ maxQueue

std::size_t Config::maxQueue = 0

Queue capacity; 0 means unlimited.

Definition at line 37 of file Config.h.

◆ seed

std::uint32_t Config::seed = 412

Random seed (logged so a run can be repeated).

Definition at line 38 of file Config.h.

◆ blockedRanges

std::vector<std::string> Config::blockedRanges {"45.0.0.0/8", "103.0.0.0/8"}

Firewall CIDR ranges.

Definition at line 39 of file Config.h.

◆ verbose

bool Config::verbose = false

Print every event instead of only status lines.

Definition at line 40 of file Config.h.

◆ color

bool Config::color = true

Use ANSI colors on a terminal.

Definition at line 41 of file Config.h.

◆ useSwitch

bool Config::useSwitch = false

Bonus: route P and S jobs to two load balancers.

Definition at line 42 of file Config.h.

◆ interactive

bool Config::interactive = false

Ask for the main settings on standard input.

Definition at line 43 of file Config.h.

◆ showHelp

bool Config::showHelp = false

Print usage and exit.

Definition at line 44 of file Config.h.

◆ statusEvery

unsigned long Config::statusEvery = 0

Cycles between status lines; 0 chooses automatically.

Definition at line 45 of file Config.h.

◆ logPath

std::string Config::logPath

File for the run summary (and events in verbose mode).

Definition at line 46 of file Config.h.


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