LALB

module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2020 License: MIT

README

HotFunctions Build Status GitHub license

A simple FaaS framework and tools to test performance of load balancing algorithms. Consists of 5 parts like described in below:

  • Worker front: Codes for the worker node to run the user functions in the Docker container.
  • Load balancer: Codes for distributing requests to multiple worker nodes
  • Simulator: Codes to run a simulation with load balancer
  • Sample functions: Pre-defined user functions to run a simulation
  • Utils: Utilities like generating simulation scenario or analyzing the result.

Run the project

Prerequisites
  • Golang >= 1.13 (Since we use gomod for dependency control, at least 1.11 is required)
  • Docker (Functions are running in the Docker container)
Step1: Configure a worker node (or worker nodes)

Follow the "How to run" section on worker front page.
After configuration, visit http://localhost:8222/execute?name=W1 to test worker node. (This command will execute function W1 and send you a response) Reponse would be like below:

{
	"Result": {
		"statusCode": 200,
		"body": "Hello World2998950"
	},
	"ExecutionTime": 3373,
	"InternalExecutionTime": 98,
	"Meta": {
		"ImageBuilt": true,
		"UsingPooledContainer": false,
		"UsingExistingRestContainer": false,
		"ContainerName": "hf_w1__9437_98081",
		"ImageName": "hf_w1"
	}
}

Our framework supports 30 different functions. You can see the detail of the supporting sample functions in sample functions page.

Step2: Configure a load balancer

Follow the "How to run" section on load balancer page.
After configuration, visit http://localhost:8111/execute?name=W1 to test load balancer. Note that you should not close the worker node while running the load balancer.

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
	}
}
Step3: Run simulator and analyze result with utils

Follow the "How to run" section on simulator page. After the simulation is finished, utils for analyzing the logs are prepared on utils.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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