All Projects → codepr → llb

codepr / llb

Licence: BSD-2-Clause license
Dead simple event-driven load-balancer

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to llb

Zeus
A high performance, cross-platform Internet Communication Engine. Developed with native socket API. Aim at handling millions of concurrent connections.
Stars: ✭ 30 (+11.11%)
Mutual labels:  multithreading, event-driven, epoll
sol
Lightweight MQTT broker, written from scratch. IO is handled by a super simple event loop based upon the most common IO multiplexing implementations.
Stars: ✭ 72 (+166.67%)
Mutual labels:  simple, event-driven, epoll
ev
Lightweight event-loop library based on multiplexing IO
Stars: ✭ 15 (-44.44%)
Mutual labels:  event-driven, epoll
epump
ePump是一个基于I/O事件通知、非阻塞通信、多路复用、多线程等机制开发的事件驱动模型的 C 语言应用开发框架,利用该框架可以很容易地开发出高性能、大并发连接的服务器程序。
Stars: ✭ 26 (-3.7%)
Mutual labels:  event-driven, epoll
Gev
🚀Gev is a lightweight, fast non-blocking TCP network library based on Reactor mode. Support custom protocols to quickly and easily build high-performance servers.
Stars: ✭ 1,082 (+3907.41%)
Mutual labels:  event-driven, epoll
libapenetwork
Fast cross-platform async network library
Stars: ✭ 17 (-37.04%)
Mutual labels:  event-driven, epoll
Libuev
Lightweight event loop library for Linux epoll() family APIs
Stars: ✭ 170 (+529.63%)
Mutual labels:  event-driven, epoll
Gnet
🚀 gnet is a high-performance, lightweight, non-blocking, event-driven networking framework written in pure Go./ gnet 是一个高性能、轻量级、非阻塞的事件驱动 Go 网络框架。
Stars: ✭ 5,736 (+21144.44%)
Mutual labels:  event-driven, epoll
Simplenetwork
simple TCP server / client C++ linux socket
Stars: ✭ 225 (+733.33%)
Mutual labels:  simple, multithreading
Mongols
C++ high performance networking with TCP/UDP/RESP/HTTP/WebSocket protocols
Stars: ✭ 250 (+825.93%)
Mutual labels:  multithreading, epoll
QtNotepad
Super lightweight and super simple notepad application
Stars: ✭ 50 (+85.19%)
Mutual labels:  simple, small-projects
netpoll
Package netpoll implements a network poller based on epoll/kqueue.
Stars: ✭ 38 (+40.74%)
Mutual labels:  event-driven, epoll
gostore
Storage algorithms.
Stars: ✭ 34 (+25.93%)
Mutual labels:  multithreading
connect
tiny cross-platform socket API library
Stars: ✭ 46 (+70.37%)
Mutual labels:  epoll
Master-Thesis
Deep Reinforcement Learning in Autonomous Driving: the A3C algorithm used to make a car learn to drive in TORCS; Python 3.5, Tensorflow, tensorboard, numpy, gym-torcs, ubuntu, latex
Stars: ✭ 33 (+22.22%)
Mutual labels:  multithreading
thread-pool
BS::thread_pool: a fast, lightweight, and easy-to-use C++17 thread pool library
Stars: ✭ 1,043 (+3762.96%)
Mutual labels:  multithreading
Hacktoberfest-Banned-The-Repo-Guys-Sorry-For-Your-Time-and-effort
A beginner-friendly open source repository to create your first pull request.
Stars: ✭ 27 (+0%)
Mutual labels:  simple
moleculer-channels
Reliable messages for Moleculer services via external queue/channel/topic.
Stars: ✭ 45 (+66.67%)
Mutual labels:  event-driven
Hexo-Theme-MengD
A simple, lightweight Hexo theme(支持:pjax、discuss、twikoo、waline、valine评论)
Stars: ✭ 69 (+155.56%)
Mutual labels:  simple
DLL-INJECTOR
I created a dll injector I am going to Open source its Code. But remember one thing that is any one can use it only for Educational purpose .I again say do not use it to damage anyone's Computer.But one thing if you are using it for some good purpose like to help someone who really need help then I permit you to use it.
Stars: ✭ 14 (-48.15%)
Mutual labels:  simple

llb

llb CI

(L)ittle(L)oad(B)alancer, a dead simple event-driven load-balancer. Supports Linux (and arguably OSX) through epoll and poll/select (kqueue on BSD-like) as fallback, it uses an event-loop library borrowed from Sol.

Written out of boredom/learning purpose (50/50) during self-isolation. Sure thing there will be bugs and plenty of corner cases to be addressed.

Features:

  • Logging
  • Configuration file on disk
  • Basic healthcheck for backends
  • TLS encryption (to be refined)
  • Daemon mode
  • Multithread event-loop
  • HTTP and TCP load-balancing
  • Round-robin, weighted round-robin, hash-balancing, random-balancing, leastconn, leasttraffic
  • Pretty small (~2000 sloc) and little dependencies (openssl)

Next:

  • Improvements on all previous points

Build

Dependencies

  • gcc
  • make
  • cmake
  • OpenSSL (libssl-dev)
$ cmake . && make

Quickstart

Backend servers at http://localhost:8080 and http://localhost:8081, balancing strategy WEIGHTED-ROUND-ROBIN

$ ./llb -v -b http://localhost:8080:2,http://localhost:8081:4 -l weighted-round-robin

A simple configuration can be passed in with -c flag:

$ ./llb -c path/to/llb.conf

As of now the configuration is very small and self-explanatory, default path is located to /etc/llb/llb.conf:

# llb configuration file, uncomment and edit desired configuration

# accepts http | tcp
mode http

# Load-balancing settings

# Frontends are the endpoint exposed as entry point for connecting clients
frontends 127.0.0.1:8789,127.0.0.1:8790,127.0.0.1:8791

# Backends is a pool of server to load-balance requests from clients
backends 127.0.0.1:6090,127.0.0.1:6090,127.0.0.1:6090

# Set round robin as balancing algorithm
# Other options available can be
# random-balancing | hash-balancing | leastconn | leasttraffic | weighted-round-robin
load_balancing round-robin

# Logging configuration

# Could be either DEBUG, INFO/INFORMATION, WARNING, ERROR
log_level DEBUG

log_path /tmp/llb.log

# TCP backlog, size of the complete connection queue
tcp_backlog 128

# TLS certs

#cafile certs/ca.crt
#certfile certs/alaptop.crt
#keyfile certs/alaptop.key

# TLS supported versions
#tls_protocols tlsv1,tlsv1_1,tlsv1_2,tlsv1_3

Executable accepts some simple arguments, in case of a configuration file specified every setting is overridden by it.

  • -h print an usage help
  • -v enable verbose debug messages
  • -d run in daemon mode
  • -c <path/to/conf> specify a configuration path, defaults to /etc/llb/llb.conf
  • -l <load-balancing-algorithm> specify a load-balancing algorithm to be used. Choices are round-robin, hash, random, leastconn, leasttraffic and weighted-round-robin
  • -m <mode> choose the run mode between tcp and http. Defaults to http
  • -b <host:port:weight>,<host:port:weight>.. add backend machines with a weight associated, it will be ignored for load-balancing algorithms other than weighted-round-robin
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].