Giter VIP home page Giter VIP logo

uscale's Introduction

uScale Loadbalancer

                           __
    __  ________________ _/ /__ 
   / / / / ___/ ___/ __ `/ / _ \
  / /_/ (__  ) /__/ /_/ / /  __/
  \__,_/____/\___/\__,_/_/\___/ 

The uScale loadbalancer is a simple high-availability loadbalancer written in C# using Watson and can be used with any HTTP/HTTPS application.

alt tag

Setup

Run the app with setup in the command line arguments to run the setup script and create a system.json file.

Definitions

  • A 'Host' is defined as a virtual resource accessible by hostname as found in the HTTP request's Host header. Hosts is an array, so you can have multiple managed virtual resources

  • A 'Node' is a physical resource mapped to a host by its hostname and port. Nodes is an array, so you can have multiple nodes mapping to a host

  • Nodes are polled at an interval according to their configuration, and removed from rotation when the maximum number of failures are reached

  • Node polling continues while a node is failed to detect return-to-service conditions

  • The HeartbeatUrl for a Node must be a full URL including the protocol, i.e. http://10.1.1.1:80/loopback. This URL must always return a 200 to indicate that the Node is online and available

  • The HandlingMode should either be Proxy or Redirect:

    • Proxy: uscale will submit a request on behalf of the requestor and marshal the response back to the requestor.
    • Redirect: uscale will send an HTTP redirect according to the configuration
  • The BalancingScheme should always be set to RoundRobin (for now)

Performance and Scale

It is recommended that you use Redirect for HandlingMode as this will unburden uscale from having to proxy each connection.

Sample Configuration

{
  "EnableConsole": true,
  "RedirectStatusCode": 302,
  "RedirectStatusString": "Moved Temporarily",
  "Hosts": [
    {
      "Name": "MyApp",
      "HttpHostNames": [
        "www.myapp.com",
        "myapp.com"
      ],
      "Nodes": [
        {
          "Hostname": "10.1.1.1",
          "Port": 80,
          "Ssl": false,
          "HeartbeatUrl": "http://10.1.1.1:80/loopback",
          "PollingIntervalMsec": 2500,
          "MaxFailures": 4,
          "Failed": false
        },
        {
          "Hostname": "10.1.1.2",
          "Port": 80,
          "Ssl": false,
          "HeartbeatUrl": "http://10.1.1.2:80/loopback",
          "PollingIntervalMsec": 2500,
          "MaxFailures": 4,
          "Failed": false
        }
      ],
      "LastIndex": 0,
      "BalancingScheme": "RoundRobin",
      "HandlingMode": "Redirect",
      "AcceptInvalidCerts": true
    }
  ],
  "Server": {
    "DnsHostname": "+",
    "Port": 9000,
    "Ssl": false
  },
  "Auth": {
    "AdminApiKeyHeader": "x-api-key",
    "AdminApiKey": "admin"
  },
  "Logging": {
    "SyslogServerIp": "127.0.0.1",
    "SyslogServerPort": 514,
    "MinimumSeverityLevel": 1,
    "LogRequests": false,
    "LogResponses": false,
    "ConsoleLogging": true
  },
  "Rest": {
    "UseWebProxy": false,
    "WebProxyUrl": "",
    "AcceptInvalidCerts": true
  }
}

Admin APIs

Using the admin API key, a set of RESTful APIs can be used to gather visibility into the loadbalancer during runtime. The admin API key header defined in the Auth section of the config can be included as a header or as a querystring key-value pair.

GET /_loadbalancer/config?x-api-key=admin
GET /_loadbalancer/connections?x-api-key=admin
GET /_loadbalancer/hosts?x-api-key=admin

uscale's People

Contributors

jchristn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.