Skip to content

Commit 5132bb9

Browse files
[Docs] Clarified the behavior of idle duration: how run's idle_duration and fleet's idle_duration are applied (#3574)
1 parent 775aff0 commit 5132bb9

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
### Idle duration
22

3-
If a run provisions a new instance, the instance stays `idle` for 5 minutes by default and can be reused within that time.
4-
If the instance is not reused within this period, it is automatically terminated.
5-
To change the default idle duration, set
6-
[`idle_duration`](../reference/dstack.yml/fleet.md#idle_duration) in the run configuration (e.g., `0s`, `1m`, or `off` for unlimited).
3+
If the run is submitted to a fleet with `nodes` set to a range and a new instance is provisioned,
4+
the shorter of the fleet's and run's `idle_duration` is used.
5+
If the run reuses an existing fleet instance, only the fleet's
6+
[`idle_duration`](../reference/dstack.yml/fleet.md#idle_duration) applies.
7+
8+
If an instance remains `idle`, it is automatically terminated after `idle_duration`.
9+
10+
> Not applied for container-based backends (Kubernetes, Vast.ai, RunPod).

docs/docs/guides/protips.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,13 @@ Or, set [`creation_policy`](../reference/dstack.yml/dev-environment.md#creation_
212212

213213
### Idle duration
214214

215-
If a run provisions a new instance, the instance stays `idle` for 5 minutes by default and can be reused within that time.
216-
If the instance is not reused within this period, it is automatically terminated.
217-
To change the default idle duration, set
218-
[`idle_duration`](../reference/dstack.yml/fleet.md#idle_duration) in the run configuration (e.g., `0s`, `1m`, or `off` for unlimited).
215+
If the run is submitted to a fleet with `nodes` set to a range and a new instance is provisioned, the shorter of the fleet's and run's `idle_duration` is used.
216+
If the run reuses an existing fleet instance, only the fleet's
217+
[`idle_duration`](../reference/dstack.yml/fleet.md#idle_duration) applies.
218+
219+
If an instance remains `idle`, it is automatically terminated after `idle_duration`.
220+
221+
> Not applied for container-based backends (Kubernetes, Vast.ai, RunPod).
219222

220223
## Volumes
221224

src/dstack/_internal/core/models/profiles.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,11 @@ class ProfileParams(CoreModel):
323323
Field(
324324
description=(
325325
"Time to wait before terminating idle instances."
326-
" Instances are not terminated if the fleet is already at `nodes.min`."
326+
" When the run reuses an existing fleet instance, the fleet's `idle_duration` applies."
327+
" When the run provisions a new instance, the shorter of the fleet's and run's values is used."
327328
" Defaults to `5m` for runs and `3d` for fleets."
328-
" Use `off` for unlimited duration"
329+
" Use `off` for unlimited duration."
330+
" Only applied for VM-based backends"
329331
)
330332
),
331333
] = None

0 commit comments

Comments
 (0)