This project simulates a simple load balancer distributing Requests to
WebServer instances. The simulation runs in discrete integer cycles and
supports dynamic scaling of servers based on queue depth.
Directory layout
include/— public headers (request.h,webserver.h,loadbalancer.h)src/— implementation sources andmain.cppMakefile— build helperDoxyfile— minimal configuration for generating HTML docs
Requires a C++17 compiler. From project root:
make./lb_sim
# then enter: <initial_servers> <duration_in_cycles>Run with 3 servers for 100 cycles:
printf "3
100
" | ./lb_simInstall Doxygen (macOS Homebrew):
brew install doxygen
doxygen DoxyfileThe HTML docs will be in docs/html/index.html.
- The simulation logs assignments, completions, scaling events, and per-cycle statuses to stdout. Redirect to a file to capture long runs.
- Adjust service/arrival parameters in
src/loadbalancer.cppfor different workloads and to experiment with scaling thresholds.
Run the included smoke script after building to verify a short run:
make
bash tools/run_smoke.shGenerated Doxygen HTML is currently in docs/html. Instead of committing
generated files to the repository, use the GitHub Action Publish Doxygen
(.github/workflows/publish_docs.yml) to build and publish docs to the
gh-pages branch. Run it from the Actions tab or via workflow_dispatch.
This project simulates a simple load balancer distributing Requests to
WebServer instances. The simulation runs in discrete integer cycles and
supports dynamic scaling of servers based on queue depth.
Directory layout
include/— public headers (request.h,webserver.h,loadbalancer.h)src/— implementation sources andmain.cppMakefile— build helperDoxyfile— minimal configuration for generating HTML docs
Requires a C++17 compiler. From project root:
make./lb_sim
# then enter: <initial_servers> <duration_in_cycles>Run with 3 servers for 100 cycles:
printf "3
100
" | ./lb_simInstall Doxygen (macOS Homebrew):
brew install doxygen
doxygen DoxyfileThe HTML docs will be in docs/html/index.html.
- The simulation logs assignments, completions, scaling events, and per-cycle statuses to stdout. Redirect to a file to capture long runs.
- Adjust service/arrival parameters in
src/loadbalancer.cppfor different workloads and to experiment with scaling thresholds.