Skip to content

Repository files navigation

FibScale

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

buildpublishlicense

Requirements

Setup

# Clone the repository
git clone https://github.com/AlphaHydrae/fibscale.git
# Install dependenciescd 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 variableDefault valueDescription
FIBSCALE_HOST0.0.0.0IP address to listen on (or 0.0.0.0 for any address).
FIBSCALE_PORT3000The port the application will listen on.
FIBSCALE_DELAY0An optional artificial delay in seconds before returning each result.
FIBSCALE_MAX10000The maximum Fibonacci number that can be computed.
FIBSCALE_RECURSIVE_MAX40The maximum Fibonacci number that can be computed with the recursive algorithm.

About

A Fibonacci calculator designed to demonstrate horizontal scaling with load balancing

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages