Skip to content

A Fibonacci calculator designed to demonstrate horizontal scaling with load balancing

License

Notifications You must be signed in to change notification settings

MediaComem/fibscale

Repository files navigation

FibScale

A Fibonacci number calculator designed to demonstrate horizontal scaling with load balancing.

build publish license

Requirements

Setup

# Clone the repository
git clone https://github.com/AlphaHydrae/fibscale.git

# Install dependencies
cd fibscale
bundle install

Run the application

Execute the following command in the application's directory:

bundle exec ruby fibscale.rb

Configuration

The FibScale application can take one optional integer argument:

bundle exec ruby fibscale.rb 3

This integer is a worker number and will change the color of the navbar (cycling through a list of seven pre-configured colors). This makes it easy to identify multiple deployed instances.

Further configuration is possible through environment variables:

Environment variable Default value Description
FIBSCALE_HOST 0.0.0.0 IP address to listen on (or 0.0.0.0 for any address).
FIBSCALE_PORT 3000 The port the application will listen on.
FIBSCALE_DELAY 0 An optional artificial delay in seconds before returning each result.
FIBSCALE_MAX 10000 The maximum Fibonacci number that can be computed.
FIBSCALE_RECURSIVE_MAX 40 The maximum Fibonacci number that can be computed with the recursive algorithm.

About

A Fibonacci calculator designed to demonstrate horizontal scaling with load balancing

Resources

License

Stars

Watchers

Forks

Packages