From d258340328053f72e5ff289d6532a5417d7e79c7 Mon Sep 17 00:00:00 2001 From: Victor Agababov Date: Mon, 18 May 2020 13:29:56 -0700 Subject: [PATCH 1/2] Add the documentation to the new scale-to-zero-pod-retention-period flag --- docs/serving/configuring-autoscaling.md | 39 ++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/docs/serving/configuring-autoscaling.md b/docs/serving/configuring-autoscaling.md index 8b2fdd01dff..a5f47dd4349 100644 --- a/docs/serving/configuring-autoscaling.md +++ b/docs/serving/configuring-autoscaling.md @@ -496,7 +496,7 @@ This period is an upper bound amount of time the system waits internally for the * **Global key:** `scale-to-zero-grace-period` * **Per-revision annotation key:** n/a -* **Possible values:** Duration +* **Possible values:** Duration, at least 6s. * **Default:** `30s` **Example:** @@ -526,6 +526,43 @@ spec: {{< /tab >}} {{< /tabs >}} + +### Scale To Zero Last Pod Retention Period + +This flag ensures that after the decision has been made by the Autoscaler to scale to 0 the last pod will remain active for at least this amount of timei, i.e minimum amount of time the last pod will linger. This is in contrast to `scale-to-zero-grace-period` flag, that determines the maximum amount of time that the last pod will stay alive. + +* **Global key:** `scale-to-zero-pod-retention-period` +* **Per-revision annotation key:** n/a +* **Possible values:** Non-negative duration string +* **Default:** `0s` + +**Example:** +{{< tabs name="scale-to-zero-grace" default="Global (ConfigMap)" >}} +{{% tab name="Global (ConfigMap)" %}} +```yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: config-autoscaler + namespace: knative-serving +data: + scale-to-zero-pod-retention-period: "42s" +``` +{{< /tab >}} +{{% tab name="Global (Operator)" %}} +```yaml +apiVersion: operator.knative.dev/v1alpha1 +kind: KnativeServing +metadata: + name: knative-serving +spec: + config: + autoscaler: + scale-to-zero-pod-retention-period: "42s" +``` +{{< /tab >}} +{{< /tabs >}} + ## Modes: Stable and Panic The KPA acts on the respective metrics (concurrency or RPS) aggregated over time-based windows. These windows define the amount of historical data the autoscaler takes into account and are used to smooth the data over the specified amount of time. The shorter these windows are, the more quickly the autoscaler will react but the more hysterically it will react as well. From 6f705fce8a9f498184854e6d91dcbb3968fb39c9 Mon Sep 17 00:00:00 2001 From: Victor Agababov Date: Tue, 19 May 2020 10:38:56 -0700 Subject: [PATCH 2/2] review --- docs/serving/configuring-autoscaling.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/serving/configuring-autoscaling.md b/docs/serving/configuring-autoscaling.md index a5f47dd4349..a6b0c792788 100644 --- a/docs/serving/configuring-autoscaling.md +++ b/docs/serving/configuring-autoscaling.md @@ -496,7 +496,7 @@ This period is an upper bound amount of time the system waits internally for the * **Global key:** `scale-to-zero-grace-period` * **Per-revision annotation key:** n/a -* **Possible values:** Duration, at least 6s. +* **Possible values:** Duration (must be at least 6s). * **Default:** `30s` **Example:** @@ -529,7 +529,9 @@ spec: ### Scale To Zero Last Pod Retention Period -This flag ensures that after the decision has been made by the Autoscaler to scale to 0 the last pod will remain active for at least this amount of timei, i.e minimum amount of time the last pod will linger. This is in contrast to `scale-to-zero-grace-period` flag, that determines the maximum amount of time that the last pod will stay alive. +The `scale-to-zero-pod-retention-period` flag determines the **minimum** amount of time that the last pod will remain active after the Autoscaler has decided to scale pods to zero. + +This contrasts with the `scale-to-zero-grace-period` flag, which determines the **maximum** amount of time that the last pod will remain active after the Autoscaler has decided to scale pods to zero. * **Global key:** `scale-to-zero-pod-retention-period` * **Per-revision annotation key:** n/a