Skip to content

gbcastilho/load-balancer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Load Balancer ⚖️

Load balancer system for the discipline Distributed Systems - UNICAMP

UsageOptionsRequestsCapacityMetrics

GIF demo

A load balancer simulator handles arriving requests and distributes them between three independent servers.

Usage

To run the project you have two options:

  1. Docker (Recommended)

If you have docker, you can build and run the project with simple commands

docker compose build
docker compose run --rm load-balancer
  1. Manual

If you prefer you can install rust mannualy and run through cargo

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo run

Options

It is possible to define how the system behaves

Balancing Mode

  • Random: The servers are chosen randomly.
  • Round Robin: The servers are chosen uniformly, regardless of their workload.
  • Smaller Queue: The server with the smallest request queue (i.e. the smallest workload) is chosen.

Arrival Rate (λ)

You can set the average number of requests arriving per second between 0 and 10.

Requests

Requests are defined by type and size.

  • Type

    • CPU Bound: It demands more CPU computing.
    • IO Bound: It demands more input/output waiting time.
    • Mixed: A mixture of previous types.
  • Size

    • Small: 100ms
    • Mid: 300ms
    • Large: 1000ms

Capacity

Currently, the maximum number of requests that each queue can store is hard-coded. However, you can easily modify this to test new scenarios.

  • Server (each): 10 requests
  • Pending list: 20 requests

Metrics

  • Total Requests: The total number of requests received.
  • Processed: Number of successfully processed requests.
  • Avarage Response Time: The average time taken to process a request since its arrival.
  • Throughput: Number of requests processed per second.

About

Distributed Systems load balancer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published