Vortex is a robust, dynamic reverse proxy, rate limiter, and cluster manager built entirely in Go. Engineered to handle fluctuating traffic seamlessly, Vortex dynamically spawns or terminates backend nodes based on real-time traffic thresholds. By leveraging the Gin framework and yaml.v3 for declarative configuration, Vortex provides an enterprise-grade load balancing solution that is highly configurable, inherently resilient, and fully observable out of the box.
- ⚡ Auto-Scaling: Intelligently spawns or kills backend nodes dynamically governed by live traffic thresholds.
- ⚖️ Load Balancing: Distributes incoming traffic efficiently using a robust Round-Robin algorithm.
- 🛡️ Rate Limiting: Protects your services from abuse and traffic spikes with built-in, configurable limits.
- ❤️ Health Checks: Ensures high availability by continuously monitoring backend node health via a background daemon.
- ⚙️ Declarative Config: Easy and version-controllable configuration using a single
vortex.yamlfile. - 📊 Observability: Fully integrated with Prometheus and Grafana for deep insights and analytics.
The Vortex architecture routes incoming requests through a robust chain of limiters and balancers, while a background daemon continuously monitors health and scales the cluster up or down based on load.
vortex/
├── daemon/ # Background auto-scaling and health checker logic
├── docker-compose.yml # Production stack orchestration
├── grafana/ # Grafana dashboards and provisioning configs
├── loadbalancer/ # Round-Robin routing and engine core
├── main.go # Application entry point
├── ratelimiter/ # Traffic parsing and rate limit enforcement
└── vortex.yaml # Declarative cluster configuration
You can run Vortex either via a quick local installation or deployed as a fully dockerized production stack.
Ensure you have Go 1.20+ installed, then simply clone and run:
# Clone the repository
git clone https://github.com/yourusername/vortex.git
cd vortex
# Run the proxy locally
go run main.goVortex comes with a fully containerized observability stack using Prometheus and Grafana, and supports hot-reloading using Air.
# Standard Start (Production build)
make up
# Development Start (Hot-reloading with Air)
make dev
# Rebuild and Start (Clean standard build)
make rebuildExpected Ports:
- Load Balancer:
8000 - Grafana:
3000(Default login:admin/admin) - Prometheus:
9090
Configure the proxy using the declarative vortex.yaml file. Set up cluster size boundaries, scaling triggers, and routing paths effortlessly.
# vortex.yaml
cluster:
max_nodes: 10
min_nodes: 2
strategy: round_robin
scaling_triggers:
cpu_threshold_percent: 80
request_rate_per_sec: 1000
scale_up_step: 2
scale_down_step: 1
rate_limit:
enabled: true
requests_per_ip: 100
window_seconds: 60Once your stack is running, you can test the load balancing by hitting the proxy:
# Send a test request to the load balancer
curl -i http://localhost:8080/Observability:
Open your browser to http://localhost:3000 to access the Grafana Dashboard. The built-in dashboard will visualize live analytics from Prometheus, showing the active cluster size, request throughput, and auto-scaling events as they happen.
Contributions make the open-source community an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request