A simple load balancer implemented using ASP.NET Core
This is a lightweight bundle that supports :
- Filters
- Chaching
- Rewrite
- Balancing
- 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.
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 ;-)
If interested, please contact me or open an issue.
Please see the full documentation at wiki page.
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.
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.
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.
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:
- Number of request coming
- Number of request pending
- Quicker response
- Affiliation (Based on Cookie)
After Balancing stage complete the computation of right url, proxy module will invoke the request repling the client.
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.
This balancer can be used in theese ways:
- As binary: using embedded or iis web hosted package, you can download it, configure changes files and run.
- 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.