Performance
Optimizing performance on Kova deployments.
Resource Allocation
CPU
- Fractional cores supported (e.g., 0.5, 1.5)
- Higher allocation = faster processing
- Over-allocation wastes money
resources:
cpu:
units: 1.5 # 1.5 CPU cores
Memory
- Specify in Mi or Gi
- Under-allocation causes OOM crashes
- Monitor actual usage to optimize
resources:
memory:
size: 1Gi # 1 gigabyte
Storage
- Persistent storage has performance overhead
- Use for data that must survive restarts
- Container filesystem is faster for temp data
Container Optimization
Image Size
- Use Alpine-based images when possible
- Remove unnecessary dependencies
- Use multi-stage builds
# Bad: 1GB image
FROM node:20
# Good: 150MB image
FROM node:20-alpine
Startup Time
- Minimize initialization logic
- Use health checks appropriately
- Consider warm-up strategies
Monitoring
Track these metrics in the dashboard:
- CPU usage: Percentage of allocated CPU
- Memory usage: Current vs allocated
- Response time: Latency of your endpoints
- Error rate: Failed requests percentage
Scaling
For high-traffic applications:
- Increase replica count in SDL
- Each replica gets placed on potentially different providers
- Load balancing is automatic
deployment:
web:
anywhere:
profile: web
count: 3 # 3 replicas