Cost vs Performance Optimization
Autopilot offers two scaling strategies to balance cost savings with performance needs. Choose based on your workload's business criticality and latency requirements.
Strategy Comparison
| Optimize for Performance | Optimize for Cost | |
|---|---|---|
| Priority | Responsiveness and headroom | Efficiency and savings |
| Capacity | Keeps spare capacity for spikes | Runs closer to the limit |
| Best for | User-facing, latency-sensitive, revenue-critical services | Internal tools, batch jobs, latency-tolerant services |
| Trade-off | Higher cost for stability | Lower cost, less spike headroom |
Optimize for Performance
How it works: Keeps higher capacity buffer, rounds up replica calculations, maintains lower utilization targets.
Best for:
- User-facing services with strict SLAs (< 100ms p99)
- Revenue-critical paths (checkout, payment, authentication)
- High-traffic production APIs
- Services where latency directly impacts user experience
Example Applications: E-commerce checkout flow, real-time bidding systems, video streaming APIs, authentication/authorization services
Quick Setup
Scaling Strategy: Optimize for Performance
Min Replicas: 5
Max Replicas: 30
Gradual Scaling: 120s
Predictive Scaling: EnabledExpected Behavior: Maintains 10-20% spare capacity, scales proactively before traffic hits, tolerates brief over-provisioning.
Optimize for Cost
How it works: Targets higher utilization, rounds normally, scales down more aggressively while maintaining reliability.
Best for:
- Internal tools and admin dashboards
- Background processing and batch jobs
- Development/staging environments
- Services with relaxed latency requirements (> 500ms acceptable)
Example Applications: Data processing pipelines, report generation services, analytics ingestion, internal APIs and tools
Quick Setup
Scaling Strategy: Optimize for Cost
Min Replicas: 2
Max Replicas: 15
Gradual Scaling: 60s
Predictive Scaling: DisabledExpected Behavior: Runs closer to capacity limits, scales down quickly during low traffic, accepts brief latency increases during sudden spikes.
Choosing Your Strategy
Use Performance When:
- Service has strict SLA requirements
- Latency directly impacts revenue or user experience
- Traffic spikes are unpredictable
- Business prefers over-provisioning to any service degradation
Use Cost When:
- Service can tolerate occasional latency spikes
- Traffic is predictable or latency-insensitive
- Budget optimization is a priority
- Service is non-customer-facing
Common Patterns
🎯 Tiered Approach (same application, different services)
Frontend API: Performance (user-facing)
Order Processing: Performance (revenue-critical)
Product Catalog: Cost (cached, less sensitive)
Analytics Pipeline: Cost (background job)Apply different strategies based on service criticality within the same application.
⏰ Time-Based Approach (same service, different times)
Use Autopilot Scheduler to switch strategies:
- Business hours (9 AM - 6 PM): Performance mode
- Off-hours (6 PM - 9 AM): Cost mode
- Weekends: Cost mode
Automatically adjust optimization based on expected traffic patterns.
Monitoring Your Choice
Watch these metrics after enabling:
Performance Mode Warning Signs:
- Average CPU consistently below 50%
- Long periods with idle replicas
- High cloud costs with minimal traffic
Fix: Switch to Cost mode or lower Max Replicas
Cost Mode Warning Signs:
- P99 latency spikes during traffic increases
- Error rates correlate with scaling events
- Users reporting slowness
Fix: Switch to Performance mode or enable Predictive Scaling
Quick Decision Guide
Ask yourself: "What happens if this service is slow for 30 seconds?"
- Business loses money / Users complain: Use Performance
- No one notices / It's acceptable: Use Cost
Example: E-Commerce Site
| Service | Strategy | Why |
|---|---|---|
| Checkout API | Performance | Direct revenue impact |
| Product Search | Performance | Core user experience |
| Product Details | Cost | Cached, less time-sensitive |
| Order History | Cost | Async, background query |
| Email Service | Cost | Queued, no real-time requirement |
Next Steps
- Predictive Scaling: Add forecasting to either strategy for proactive scaling
- Autopilot Scheduler: Automatically switch strategies based on time
- Timing Controls: Fine-tune scale-down behavior for your strategy