Git Product home page Git Product logo

.net-load-balancer's Introduction

.Net-Load-Balancer

A simple load balancer implemented using ASP.NET Core

This is a lightweight bundle that supports :

  1. Filters
  2. Chaching
  3. Rewrite
  4. Balancing
  5. Transformation

Whole application is written in .NET Core, so it can be run as embedded app or in a webserver.

The main principle is to provide an easy to use solution that can be installed in 5 minutes.

Every feature of application is implemented with its own owin module that can be enabled or disabled by cofiguration. Each module is configurable by a dedicated config file.

Where I can Download it?

At the moment, there aren't any release available. This is beacause I'm still working on it, please be patient. You cannot download a release package but you can clone and compile. Please open an issue or contact me to let me know if this project may be useful and of use for you. This will make me work harder ;-)

Contibute

If interested, please contact me or open an issue.

How .Net Load Balancer works

Please see the full documentation at wiki page.

Filters

This module provide an easy way to filter request based on some rules. All request that match the filter will be dropped. Each url is tested over a set of rule. If the url matches the rule then the request will be dropped. Only one match determine the rule activations so, basically, all rules are "OR" conditions by default. Each rule can test a set of request parameters (url, agent, headers). Inside a single rule, all condition must be true to activate it. This means that we are working with something like this ( CONDITION A AND CONDITION B) OR (CONDITION C) and this will support most cases.

Chaching

By using standard .NET Core caching module we can provide cache support for url, defining policy, etc. Caching has many options that are basically a wrap of the original module, so you ca referr to here for more details.

Rewrite

This stage will allow static rewrite rule. This is often demanded to the application but can be implemented here to simplify server part or to map virtual urls over many different applications. This is mostly a way to couple external url with internal one in case there isnt' a way to change balanced applications. Balancer itself will balance the output of this transformation.

Balancig

This is the core module that define, for each url wath will be the destination. This step generates only the real path, replacing selected host. The host can be selected using one of the following algorithm:

  1. Number of request coming
  2. Number of request pending
  3. Quicker response
  4. Affiliation (Based on Cookie)

Proxy

After Balancing stage complete the computation of right url, proxy module will invoke the request repling the client.

Transformation

Based on rules, similar to filters, you can define some regular expression to alter content. In that way you can replace absolute urls with the proxy one, or change local url with cdn ones.

How to use

This balancer can be used in theese ways:

  1. As binary: using embedded or iis web hosted package, you can download it, configure changes files and run.
  2. As library: downloading from nuget, you can create your own bundle where you can add feature or complicate logics.

What package is for me? My suggestion is to start with binary pack then, if you'll need will be out of the standards, you will implement your custom rules to modules to add to the queue.

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.