msantos / genlb-ptrace

connect(2) load balancer for Unix processes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

genlb - connection load balancer for Unix processes

SYNOPSIS

genlb [-c strategy|-v] command arg ...

DESCRIPTION

genlb monitors a subprocess, intercepting calls to connect(2) using ptrace(2).

If the destination of the connect(2) matches an IP address/port, genlb probes a list of IP addresses and rewrites the connect(2) in the subprocess to use the first working IP.

genlb uses the libglb LD_PRELOAD library for the connect(2) load balancing.

EXAMPLES

## Create 2 test listeners

# shell 1
nc -vvv -k -l 127.3.0.1 8000

# shell 2
nc -vvv -k -l 127.3.0.2 8000

## Load balanced client
LD_PRELOAD=libglb.so \
GLB_OPTIONS="--random 127.0.0.1:8000 127.3.0.1 127.3.0.2" \
genlb nc -vvv 127.0.0.1 8000

ENVIRONMENT VARIABLES

LD_PRELOAD=libglb.so : Set path to libglb

GLB_OPTIONS : See https://github.com/msantos/genlb/blob/master/README.md

OPTIONS

-c, --connect-failure exit|continue : Behaviour on connect(2) failure

-v, --verbose : Enable debug messages

BUILDING

Quick Install

make

SEE ALSO

About

connect(2) load balancer for Unix processes

License:ISC License


Languages

Language:C 95.7%Language:Shell 2.4%Language:Makefile 1.9%