Skip to content

arjunmahishi/loadbalancer-in-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published