This project is intended exclusively for testing and educational purposes. It was primarily generated using AI tools.
High-performance dynamic load balancer with intelligent routing based on user IDs (UID). Built with OpenResty (Nginx + Lua) and Docker, featuring:
- Dynamic UID Routing
- Route requests to specific backends using
uids.lstfile - Supports hot-reloading of UID list (every 30s)
- Route requests to specific backends using
- Multi-level Caching
- L1: Cookie-based persistence
- L2: In-memory LRU cache (1000 entries)
- L3: Shared memory cache for UID lookups
- Performance Optimizations
- 50k+ RPS capability
- 1ms average latency
- Asynchronous file loading
- Advanced Monitoring
- Built-in latency tracking
- Request distribution metrics
- Error rate monitoring
- Docker & Docker Compose
- Python 3.8+ (for load testing)
# 1. Build and start services
docker-compose up -d --build
# 2. Check service status
docker-compose ps
# 3. Run load test (10,000 requests)
python load_test.py --url http://localhost:8080 --requests 10000 --threads 50 --special 20
# 4. Check logs
docker-compose logs -f proxy