项目作者: mattborghi

项目描述 :
General Load Balancer Pattern for ZMQ
高级语言: Python
项目地址: git://github.com/mattborghi/load-balancer-zmq.git
创建时间: 2021-01-20T14:50:04Z
项目社区:https://github.com/mattborghi/load-balancer-zmq

开源协议:MIT License

下载


Load Balancing General implementation

Implementation of a general load balancing pattern.

We will one Client generating tasks connected to a Broker Proxy which distributes the work across workers. After each worker finish their job they send the results to a Sink. This Sink returns the results back to the Client.

The Proxy must distribute the tasks evenly between workers and in case of worker failure its remaining tasks will be sent to other workers.

Install

  1. pipenv install git+https://github.com/mattborghi/load-balancer-zmq/#egg=LoadBalancer

or

  1. pipenv update

if the package is already present on the Pipenv file.

Local development instructions

Set working environment

  1. pipenv install
  2. pipenv shell

A. Together

  1. python main.py

B. Separately

Run controller

  1. python LoadBalancer/controller.py

Run this line for each worker you want to spawn in a separater terminal

  1. python LoadBalancer/worker.py

Run Sink

  1. python LoadBalancer/sink.py

Generate release files with name based on setup.py

  1. python setup.py sdist bdist_wheel