@function() sandboxes automatically.
In most cases, you do not need to configure anything. Start with defaults, then tune only if you have a specific latency or cost goal.
Default Behavior
With just@function(), Tensorlake does this automatically:
- Creates containers when requests arrive
- Scales to zero when idle
- Adds more containers as traffic grows
Scaling Settings
Use these only when default on-demand scaling is not enough:| Setting | What it controls | What happens |
|---|---|---|
warm_containers | Ready-to-serve buffer | Keeps extra pre-started containers ready so bursts start faster |
max_containers | Capacity ceiling | Caps total containers so scale and cost stay bounded |
warm_containersadds ready capacity above current demand.max_containerslimits the final upper bound.- If demand exceeds
max_containers, requests wait in queue.
Practical Examples
1) Reduce cold starts
If this is a user-facing endpoint and startup delay is noticeable:2) Cap spend or protect downstream APIs
If you need to bound scale:3) Balance low latency with bounded scale
If you want faster startup plus bounded scaling:- 2 warm containers are ready for faster responses
- Scale is still capped at 20 containers
4) High-throughput with a safety ceiling
How to Choose Values
Start with@function() and add knobs only for a specific goal:
- Lower first-request latency: set
warm_containers=1, then increase gradually. - Budget or downstream protection: set
max_containersto a safe upper limit. - Stable setup: add a small
warm_containersbuffer, then cap withmax_containers. - Keep changes incremental: update one knob, test, then adjust.
Learn More
Scale-Out & Queuing
How queueing works when demand exceeds available capacity
Rate Limits
Pattern for handling transient API failures safely