Scaling
Scaling Overview
Horizontal Scaling
Shared Subscription Scaling
# Enable shared subscriptions in your routes
from core.router import Router
router = Router()
# Scale with multiple workers for high-throughput routes
router.on("sensors/{device_id}/data",
SensorController.process_data,
shared=True,
worker_count=5) # 5 workers for this route
# Different scaling for different routes
router.on("alerts/{device_id}",
AlertController.handle_alert,
shared=True,
worker_count=2) # 2 workers for alerts
# Non-shared for order-dependent processing
router.on("commands/{device_id}",
CommandController.execute_command,
shared=False) # Single worker maintains orderContainer-Based Horizontal Scaling
Docker Swarm Scaling
Kubernetes Horizontal Scaling
Multi-Instance Configuration
Instance Coordination
Load Distribution Strategies
Vertical Scaling
Resource Optimization
CPU Scaling
Memory Scaling
Worker Process Scaling
Dynamic Worker Adjustment
Database Scaling
Read Replicas
Connection Pool Scaling
Auto-scaling
Kubernetes Horizontal Pod Autoscaler
Custom Metrics for Auto-scaling
Cloud Auto-scaling
AWS ECS Auto-scaling
AWS Lambda Auto-scaling
Performance Monitoring for Scaling
Scaling Metrics Dashboard
Load Testing for Scaling Validation
Scaling Best Practices
Guidelines
Common Pitfalls
Resource Planning
Next Steps
Last updated