Coder Social home page Coder Social logo

balance's Introduction

balance

Simple TCP/HTTP/HTTPS load balancer in Go

Install

go get github.com/darkhelmet/balance

Usage

# Simple tcp mode
balance tcp -bind :4000 localhost:4001 localhost:4002

# HTTP mode
balance http -bind :4000 localhost:4001 localhost:4002

# HTTPS mode
balance https -bind :4000 -cert ssl.crt -key ssl.key localhost:4001 localhost:4002

License

GNU AGPL, see LICENSE file.

balance's People

Contributors

darkhelmet avatar sbinet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

balance's Issues

pass ip through LB

is it possible to obtain the IP requesting the LB with the api balance server endpoints? currently when i make a request to the LB the ip address being used in the api servers is that of the load balancer. Im using the tcp balancer. Maybe this is something that should be done with curl?

Append string to tcp uri

As per our discussion yesterday, id like to append the ip address to the uri being passed to the server instances in the tcp balancer. How do i accomplish that? I can generate the IP but i need to know how to modify the uri

connect: cannot assign requested address

This causes 502 errors to get returned to the client.

The error shows up when too many connections go into TIME_WAIT status. On my 10 core linux server vm, this was happening after 20,000 connections got in TIME_WAIT status.

START load balancer:

./balance https -cert server.crt -key server.key -bind server2:443 server1:8080
$ ./bombardier-linux-amd64 -c 1000 -n 100000 --cert server.crt --key server.key -k 'https://host/rest

Bombarding https://host/rest with 100000 request(s) using 1000 connection(s)
 100000 / 100000 [========================] 100.00% 35s
Done!
Statistics        Avg      Stdev        Max
  Reqs/sec      2952.75    3967.86   49817.90
  Latency      350.55ms   753.03ms      7.84s
  HTTP codes:
    1xx - 0, 2xx - 81879, 3xx - 0, 4xx - 0, 5xx - 18121
    others - 0
  Throughput:     1.13MB/s

ERRORS:

connect: cannot assign requested address

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.