Overview
The Warm Pool is a container management system that maintains pre-warmed, ready-to-use containers for each supported runtime. This dramatically reduces cold start latency from seconds to milliseconds.How It Works
Performance Benefits
| Metric | Without Warm Pool | With Warm Pool | Improvement |
|---|---|---|---|
| Cold Start | 2-5 seconds | 50-100ms | 20-50x faster |
| First Request | ~3 seconds | ~80ms | 37x faster |
| Container Overhead | High | Minimal | Eliminated |
Configuration
Environment Variables
Pool Size Recommendations
| Use Case | Pool Size | Notes |
|---|---|---|
| Development | 1-2 | Lower resource usage |
| Production (Low Traffic) | 3-5 | Good balance |
| Production (High Traffic) | 10+ | Scale as needed |
Container Lifecycle
1. Container Creation
Containers are pre-created and warmed during startup:2. Container Acquisition
When a request arrives:3. Container Reset & Return
After execution, containers are reset and returned to the pool:- No data leakage between executions
- Clean environment variables
- Fresh filesystem state
- Reset resource counters
Health Monitoring
The warm pool continuously monitors container health:Health Check Types
- Liveness Check: Container is running
- Readiness Check: Runtime is initialized
- Resource Check: Memory/CPU within limits
Auto-Replacement
Unhealthy containers are automatically replaced:Advanced Configuration
Per-Runtime Settings
Configure pool size per language:TTL Management
Containers are recycled after TTL expires to prevent resource drift:Monitoring
Metrics
The warm pool exposes the following metrics:| Metric | Description |
|---|---|
warm_pool_size | Current pool size per runtime |
warm_pool_hits | Requests served from pool |
warm_pool_misses | Requests requiring new containers |
warm_pool_health_failures | Health check failures |
API Endpoint
Check warm pool status:Best Practices
Size your pool appropriately
Size your pool appropriately
Monitor your traffic patterns and adjust pool size. Too small causes misses; too large wastes resources.
Use health checks
Use health checks
Enable health checks to ensure containers are ready for requests.
Set appropriate TTL
Set appropriate TTL
Balance between container freshness and startup costs. 1-4 hours is typical.
Monitor hit rate
Monitor hit rate
Aim for 95%+ hit rate. If lower, increase pool size or investigate traffic patterns.
Troubleshooting
High Miss Rate
If experiencing many pool misses:- Increase
WARM_POOL_SIZE_PER_RUNTIME - Check for bursty traffic patterns
- Verify health checks aren’t failing
Memory Issues
If containers are using too much memory:- Reduce
WARM_POOL_SIZE_PER_RUNTIME - Lower
WARM_POOL_CONTAINER_TTL - Check for memory leaks in executed code