The High Performance Proxy/Load Balancer

Overview

Silverwind-The Next Generation High-Performance Proxy

build License: GPL v3

English 简体中文

The Silverwind is a high-performance reverse proxy/load balancer. And it could be also used as the ingress controller in the k8s.

Sivlverwind-Dashboard

Start the Sivlverwind-Dashboard over docker-compose.
The docker-compose.yaml is like following:

version: "3.9"
services:
  silverwind-dashboard:
    image: lsk569937453/silverwind-dashboard:0.0.4
    container_name: silverwind-dashboard
    ports:
      - "4486:4486"

  silverwind:
      image: lsk569937453/silverwind:0.0.4
      container_name: silverwind
      ports:
        - "6980:6980"
      environment:
        ADMIN_PORT: 6980

You could check the main page for Silverwind -Dashboard after you execute the docker-compose up command.

Why we chose Sivlverwind

Benchmarks

We do the performance testing between several popular proxies including NGINX, Envoy, and Caddy. The benchmarks show here.

The test results show that under the same machine configuration (4 cores 8G), in some indicators (requests per second, average response time), the data of Silverwind is almost the same as the NGINX and Envoy. In terms of request latency, Silverwind is better than NGINX and Envoy.

All basic functions are developed in native language - fast

Silverwind is not only a reverse proxy/load balancer, but also an API gateway. As an API gateway, Silverwind will cover all basic functions (black and white list/authorization/fuse limit/gray release , blue-green publishing/monitoring/caching/protocol conversion).

Compared with other gateways, Silverwind has the advantage of covering all the basic services of the API gateway, and has high performance. Second, Silverwind's dynamic configuration is close to real-time. Every time the configuration is modified, it will take effect within 5 seconds (close to real-time).

Kong

The free Ratelimiting plugin for Kong is inaccurate. If we want to achieve more accurate Ratelimiting, we have to buy the enterprise version of Kong.

Envoy

Envoy does not have built-in ratelimiting. Envoy provides a ratelimiting interface for users to implement by themselves. Currently the most used is this project. The first disadvantage is that the project only supports fixed-window ratelimiting. The disadvantage of the fixed window ratelimiting is that it does not support burst traffic. The second disadvantage is that every time Envoy is requested, it will use grpc to request the ratelimiting cluster. Compared with the built-in current limiting algorithm, this actually adds an additional network hop.

Dynamic Configuration

You could change the configuration over the rest API. And the new configuration will have an effect in 5 seconds.

Compile or Download the release

Compile

You have to install the rust first.

cd rust-proxy
cargo build --release

You could get the release in the target/release.

Download the release

Download the release from the website.

Config Introduction

Silverwind as the http proxy

- listen_port: 9969
  service_config:
    server_type: HTTP
    routes:
    - matcher:
        prefix: /
        prefix_rewrite: ssss
      route_cluster:
        type: RandomRoute
        routes:
        - base_route:
            endpoint: http://localhost:8888/
            try_file: null
        - base_route:
            endpoint: http://localhost:9999/
            try_file: null
        - base_route:
            endpoint: http://localhost:7777/
            try_file: null

The proxy will listen the 9969 port and forward the traffic to the http://localhost:8888/,http://localhost:9999/.http://localhost:7777/.

Silverwind as the tcp proxy

- listen_port: 4486
  service_config:
    server_type: TCP
    routes:
    - matcher:
        prefix: "/"
        prefix_rewrite: ssss
      route_cluster:
        type: RandomRoute
        routes:
        - base_route:
            endpoint: httpbin.org:443
            try_file: null

Setup:

Windows Startup

$env:CONFIG_FILE_PATH='D:\code\app_config.yaml'; .\rust-proxy.exe

Or you could start without the config file like the following:

.\rust-proxy.exe

Rest Api

Change the routes

POST /appConfig HTTP/1.1
Host: 127.0.0.1:8870
Content-Type: application/json
Content-Length: 1752

[
    {
        "listen_port": 4486,
        "service_config": {
            "server_type": "HTTP",
            "cert_str": null,
            "key_str": null,
            "routes": [
                {
                    "matcher": {
                        "prefix": "ss",
                        "prefix_rewrite": "ssss"
                    },
                    "allow_deny_list": null,
                    "route_cluster": {
                        "type": "WeightBasedRoute",
                        "routes": [
                            {
                                "base_route": {
                                    "endpoint": "http://localhost:10000",
                                    "try_file": null
                                }
                            }
                        ]
                    }
                },
                {
                    "matcher": {
                        "prefix": "sst",
                        "prefix_rewrite": "ssss"
                    },
                    "allow_deny_list": null,
                    "route_cluster": {
                        "type": "WeightBasedRoute",
                        "routes": [
                            {
                                "base_route": {
                                    "endpoint": "http://localhost:9898",
                                    "try_file": null
                                }
                            }
                        ]
                    }
                }
            ]
        }
    }
]

Get the routes

GET /appConfig HTTP/1.1
Host: 127.0.0.1:8870

The Base Function in Api Gateway

alt tag

Silverwind has implemented the following functions:

  • IP Allow-and-Deny list
  • Authentication(Basic Auth,ApiKey Auth)
  • Rate limiting(Token Bucket,Fixed Window)
  • Routing
  • Load Balancing(Poll,Random,Weight,Header Based)
  • Dynamic Configuration(Rest Api)
  • Dashboard For Silverwind
  • Monitoring(Prometheus)

Future

  • Protocol Translation
  • Caching
You might also like...
Drpc-Correct, high performance, robust, easy use Remote invocation framework
Drpc-Correct, high performance, robust, easy use Remote invocation framework

Drpc - Correct, high performance, robust, easy use Remote invocation framework

High performance I/O framework written by Rust inspired by Netty
High performance I/O framework written by Rust inspired by Netty

Introduction Retty is a High performance I/O framework written by Rust inspired by Netty 基于mio的IO多路复用高并发、高性能网络通信开发框架 Feature Rayon 线程池包装 EventLoop / E

Volo is a high-performance and strong-extensibility Rust RPC framework that helps developers build microservices.
Volo is a high-performance and strong-extensibility Rust RPC framework that helps developers build microservices.

Volo is a high-performance and strong-extensibility Rust RPC framework that helps developers build microservices.

A high performance/low-overhead OpenMetrics library for Rust

* * * EXPERIMENTAL * * * discreet-metrics A high-performance/low-overhead metrics library aiming to conform with OpenMetrics and to satisfy the follow

🚀 10x easier, 🚀 10x cheaper, 🚀 high performance,  🚀 petabyte scale - Elasticsearch/Splunk/Datadog alternative for 🚀 (logs, metrics, traces).
🚀 10x easier, 🚀 10x cheaper, 🚀 high performance, 🚀 petabyte scale - Elasticsearch/Splunk/Datadog alternative for 🚀 (logs, metrics, traces).

🚀 10x easier, 🚀 10x cheaper, 🚀 petabyte scale - Elasticsearch/Splunk/Datadog alternative for 🚀 (logs, metrics, traces). ZincObserve ZincObserve is

A library-first, lightweight, high-performance, cloud-native supported API gateway🪐 by RUST

Preview version, will not guarantee the stability of the API! Do NOT use in production environment! A library-first, lightweight, high-performance, cl

A high-performance, lightweight, and cross-platform QUIC library

TQUIC English | 中文 TQUIC is a high-performance, lightweight, and cross-platform library for the IETF QUIC protocol. Advantages High performance: TQUIC

Easy per application transparent proxy built on cgroup.

cproxy can redirect TCP and UDP traffic made by a program to a proxy, without requiring the program supporting a proxy. Compared to many existi

server security proxy write by Rust

server-security-proxy server security proxy write by Rust how to use config toml file

Owner
null
Layer 4 load balancer with dynamic configuration loading

Convey Layer 4 load balancer with dynamic configuration loading featuring proxy, passthrough and direct server return modes Features Stats page (at /s

Ben Parli 289 Jan 1, 2023
Web3-proxy: a fast caching and load balancing proxy for web3 (Ethereum or similar) JsonRPC servers.

web3-proxy Web3-proxy is a fast caching and load balancing proxy for web3 (Ethereum or similar) JsonRPC servers. Signed transactions (eth_sendRawTrans

null 55 Jan 8, 2023
Cloud Native high performance security and privacy SQL proxy.

Fern proxy With the advent of Cloud Native applications, architecture patterns evolved and emerged to take advantage of cloud computing, and build mor

Fern 12 Nov 7, 2022
Proxy sentry request to a sentry server using a tunnel/proxy endpoint

Sentry Tunnel This is a proxy that forwards tunneled sentry requests to the real sentry server. The implementation is based on the explanation provide

Paul FLORENCE 14 Dec 20, 2022
UDP proxy with Proxy Protocol and mmproxy support

udppp UDP proxy with Proxy Protocol and mmproxy support. Features Async Support Proxy Protocol V2 SOCKET preserve client IP addresses in L7 proxies(mm

b23r0 10 Dec 18, 2022
Lightweight proxy that allows redirect HTTP(S) traffic through a proxy.

Proxyswarm Proxyswarm is a lightweight proxy that allows redirect HTTP(S) traffic through a proxy. WARNING: This app isn't recomended for download lar

Jorge Alejandro Jimenez Luna 4 Apr 16, 2022
A TCP proxy using HTTP - Reach SSH behind a Nginx reverse proxy

?? TCP over HTTP ?? The Questions ?? What does it do? You can proxy TCP traffic over HTTP. A basic setup would be: [Your TCP target] <--TCP-- [Exit No

Julian 185 Dec 15, 2022
A high performence Socks5 proxy server with bind/reverse support implementation by Rust.

rsocx A high performence Socks5 proxy server with bind/reverse support implementation by Rust Features Async-std No unsafe code Single executable Linu

b23r0 259 Jan 6, 2023
High-performance link shortener

shorty High-performance link shortener written in Rust ?? Hosting In addition to being easy to build from source, shorty is available as a Docker imag

Caleb Denio 49 Jan 3, 2023
A high performance TCP SYN port scanner.

Armada A High-Performance TCP SYN scanner What is Armada? Armada is a high performance TCP SYN scanner. This is equivalent to the type of scanning tha

resync 259 Dec 19, 2022