loadbalancer-in-go

command module
v0.0.0-...-f5a0b09 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2022 License: MIT Imports: 7 Imported by: 0

README

loadbalancer-in-go

Building a loadbalancer from scratch. DO NOT use this in production :P (just in case)

Running it

Start multiple instances of server.py

# create a virtual env (optional)
virtualenv env
source env/bin/activate

# install flask
pip install flask

# spawn multiple servers
for i in {1..5}; do python server.py "server-$i" "500$i" &; done

Start the loadbalancer

go run loadbalancer.go

Bombard the loadbalancer with requests

for i in {1..20}; do curl 127.0.0.1:8000; done

To kill all the instances of the servers

pkill -9 python

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL