load_balancer

command module
v0.0.0-...-154c96d Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: MIT Imports: 13 Imported by: 0

README

Load Balancer

Distribute functions to worker nodes. There are 5 different scheduling algorithms in the framework like in the below:

  • Round Robin
  • Least Loaded: Equivalent with least connected of NGINX
  • Consistent Hashing with bounded load: Variation of Consistent Hashing algorithm that limits the load per each node (arxiv)
  • PASch Extended: An extended version changing the package id to an application name of the PASch algorithm
  • Ours: Proposing algorithm that maximizes locality while minimizing load imbalance
Configuring worker nodes

We recommended you to configure two or more worker nodes to use the load balancer correctly. After configuring worker nodes, edit nodes.config.json before starting the load balancer. Note that the http protocol and port number should be included in the file.

How to run
go run *.go rr|ll|ch|pasch|ours

Options rr, ll, ch, pasch, ours mean Round Robin, Least Loaded, Consistent Hashing with bounded load, PASch extended, and Ours, respectively.

Load balancer will send a similar response with worker node, but additional information from load balancing will be appended to the response like below.

{
	"Result": {
		"statusCode": 200,
		"body": "Hello World2999663"
	},
	"ExecutionTime": 929,
	"InternalExecutionTime": 98,
	"Meta": {
		"ImageBuilt": false,
		"UsingPooledContainer": false,
		"UsingExistingRestContainer": false,
		"ContainerName": "hf_w1__9572_27887",
		"ImageName": "hf_w1"
	},
	"LoadBalancingInfo": {
		"WorkerNodeId": 0,
		"WorkerNodeUrl": "http://localhost:8222",
		"Algorithm": "ours",
		"AlgorithmLatency": 0.015869140625
	}
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
scheduler module

Jump to

Keyboard shortcuts

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