How manjeetjay/adaptive-lb-m works
ALB-M is a research-oriented Layer-7 adaptive load balancer. Requests enter the gateway, which discovers worker instances, selects one using a configurable routing strategy and live telemetry, then forwards traffic. Workers expose workload and chaos controls plus metrics; a separate benchmark harness exercises strategies and fault scenarios, and the frontend presents live controls and research results. The README documents additional observability and experiment capabilities; some implementation paths are unsampled, so those branches are shown only where supported by documentation or indexed references.
Main entry points: AdaptiveRoutingFilter.java Routing filter · orchestrator.py Experiment orchestrator · App.jsx Research dashboard · MetricPollerService.java Metric poller
Components 29
Gateway routing
- Routing filter
gateway/src/main/java/com/alb/gateway/routing/filter/AdaptiveRoutingFilter.java - Routing strategies
gateway/src/main/java/com/alb/gateway/routing/strategy - Strategy registry
gateway/src/main/java/com/alb/gateway/routing/engine/RoutingStrategyRegistry.java - Metric poller
gateway/src/main/java/com/alb/gateway/routing/adaptive/MetricPollerService.java - Metric cache
gateway/src/main/java/com/alb/gateway/routing/adaptive/MetricCache.java - Scoring and normalization
gateway/src/main/java/com/alb/gateway/routing/adaptive/CompositeScoreCalculator.java - Adaptive configuration
gateway/src/main/java/com/alb/gateway/routing/adaptive/AdaptiveRoutingConfig.java - Routing admin API
gateway/src/main/java/com/alb/gateway/admin/RoutingAdminController.java - Connection tracking
gateway/src/main/java/com/alb/gateway/routing/engine/InstanceConnectionTracker.java - Instance metric snapshot
gateway/src/main/java/com/alb/gateway/routing/model/InstanceMetricsSnapshot.java
Workers and faults
- Worker service
demo-worker/src/main/java/com/alb/worker/controller/WorkerController.java - Worker telemetry
demo-worker/src/main/java/com/alb/worker/metrics/WorkerMetricsService.java - Chaos controls
demo-worker/src/main/java/com/alb/worker/chaos/ChaosController.java - Fault injection
demo-worker/src/main/java/com/alb/worker/chaos/ChaosService.java - Chaos request filter
demo-worker/src/main/java/com/alb/worker/chaos/ChaosFilter.java
Benchmark evaluation
- Experiment orchestrator
experiments/orchestrator.py - Benchmark simulator
experiments/benchmark_simulator.py - Seven load scenarios
experiments/scenarios - Host calibration
experiments/calibration.py - Statistical analysis
experiments/analysis/compute_stats.py
Research frontend
- Benchmark explorer
frontend/src/components/BenchmarkExplorer.jsx - Visualizations
frontend/src/components/Visualizations.jsx - Hypothesis testing
frontend/src/components/HypothesisTesting.jsx - Live console
frontend/src/components/LiveConsole.jsx - Paper viewer
frontend/src/components/PaperViewer.jsx - Research dashboard
frontend/src/App.jsx
Service discovery
- Service registry
service-registry/src/main/java/com/alb/registry/ServiceRegistryApplication.java
Other components
- Traffic clients
- Research operator
Connections 37
- Traffic clients → Routing filter: sends traffic
- Routing filter → Service registry: discovers instances
- Routing filter → Routing strategies: selects instance
gateway/src/main/java/com/alb/gateway/routing/filter/AdaptiveRoutingFilter.java - Routing filter → Strategy registry: gets active strategy
gateway/src/main/java/com/alb/gateway/routing/filter/AdaptiveRoutingFilter.java - Routing filter → Metric cache: reads metrics
gateway/src/main/java/com/alb/gateway/routing/filter/AdaptiveRoutingFilter.java - Routing filter → Connection tracking: tracks connections
gateway/src/main/java/com/alb/gateway/routing/filter/AdaptiveRoutingFilter.java - Routing filter → Worker service: forwards request
- Metric poller → Worker service: scrapes telemetry
gateway/src/main/java/com/alb/gateway/routing/adaptive/MetricPollerService.java - Metric poller → Scoring and normalization: scores snapshots
gateway/src/main/java/com/alb/gateway/routing/adaptive/MetricPollerService.java - Metric poller → Metric cache: updates snapshots
gateway/src/main/java/com/alb/gateway/routing/adaptive/MetricPollerService.java - Metric poller → Connection tracking: reads connections
gateway/src/main/java/com/alb/gateway/routing/adaptive/MetricPollerService.java - Scoring and normalization → Adaptive configuration: uses thresholds
gateway/src/main/java/com/alb/gateway/routing/adaptive/CompositeScoreCalculator.java - Scoring and normalization → Instance metric snapshot: scores metrics
gateway/src/main/java/com/alb/gateway/routing/adaptive/CompositeScoreCalculator.java - Metric cache → Instance metric snapshot: stores snapshots
gateway/src/main/java/com/alb/gateway/routing/adaptive/MetricCache.java - Strategy registry → Routing strategies: registers implementations
gateway/src/main/java/com/alb/gateway/routing/engine/RoutingStrategyRegistry.java - Routing admin API → Strategy registry: switches strategy
gateway/src/main/java/com/alb/gateway/admin/RoutingAdminController.java - Routing admin API → Metric cache: reports telemetry
gateway/src/main/java/com/alb/gateway/admin/RoutingAdminController.java - Routing admin API → Connection tracking: sets instance weights
gateway/src/main/java/com/alb/gateway/admin/RoutingAdminController.java - Worker service → Worker telemetry: records workload
demo-worker/src/main/java/com/alb/worker/controller/WorkerController.java - Chaos controls → Fault injection: configures faults
demo-worker/src/main/java/com/alb/worker/chaos/ChaosController.java - Chaos request filter → Fault injection: applies injected faults
- Worker telemetry → Metric poller: exports scrape metrics
- Worker service → Service registry: registers instances
- Research operator → Experiment orchestrator: runs experiments
experiments/orchestrator.py - Experiment orchestrator → Seven load scenarios: executes scenarios
experiments/orchestrator.py - Experiment orchestrator → Benchmark simulator: simulates runs
experiments/orchestrator.py - Experiment orchestrator → Host calibration: calibrates host
experiments/orchestrator.py - Experiment orchestrator → Routing filter: configures routing
experiments/orchestrator.py - Experiment orchestrator → Chaos controls: injects worker faults
experiments/orchestrator.py - Experiment orchestrator → Statistical analysis: produces experiment data
- Research operator → Research dashboard: explores results
frontend/src/App.jsx - Research dashboard → Benchmark explorer: renders tab
frontend/src/App.jsx - Research dashboard → Visualizations: renders tab
frontend/src/App.jsx - Research dashboard → Hypothesis testing: renders tab
frontend/src/App.jsx - Research dashboard → Live console: renders tab
frontend/src/App.jsx - Research dashboard → Paper viewer: renders tab
frontend/src/App.jsx - Research dashboard → Routing admin API: checks gateway status
frontend/src/App.jsx