From 12af30cba4c74fe242faf440fd9f0967f5f5e204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=9D=B0=E7=A9=8E=20=28Jay=20Lee=29?= Date: Mon, 24 Jul 2023 23:56:49 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20correct=20the=20dominator=20of=20memory?= =?UTF-8?q?=20and=20examples=20in=20resource-durati=E2=80=A6=20(#11432)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jay Lee --- docs/resource-duration.md | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/docs/resource-duration.md b/docs/resource-duration.md index 8578526bebf2..fb02b1d2f441 100644 --- a/docs/resource-duration.md +++ b/docs/resource-duration.md @@ -18,7 +18,7 @@ Each indicator is divided by a common denominator depending on resource type. Each resource type has a denominator used to make large values smaller. * CPU: `1` -* Memory: `1Gi` +* Memory: `100Mi` * Storage: `10Gi` * Ephemeral Storage: `10Gi` * All others: `1` @@ -26,8 +26,8 @@ Each resource type has a denominator used to make large values smaller. The requested fraction of the base amount will be multiplied by the container's run time to get the container's Resource Duration. -For example, if you've requested `100Mi` of memory (one tenth of the base amount), and the container -runs 120sec, then the reported Resource Duration will be `12sec * (1Gi memory)`. +For example, if you've requested `50Mi` of memory (half of the base amount), and the container +runs 120sec, then the reported Resource Duration will be `60sec * (100Mi memory)`. ### Request Defaults @@ -39,13 +39,13 @@ set `requests` and/or `limits` for all containers. ### Example -A pod that runs for 3min, with a CPU limit of `2000m`, no memory request and an `nvidia.com/gpu` +A pod that runs for 3min, with a CPU limit of `2000m`, a memory limit of `1Gi` and an `nvidia.com/gpu` resource limit of `1`: ```text CPU: 3min * 2000m / 1000m = 6min * (1 cpu) -Memory: 3min * 100Mi / 1Gi = 18sec * (100Mi memory) -GPU: 3min * 1 / 1 = 2min * (1 nvidia.com/gpu) +Memory: 3min * 1Gi / 100Mi = 30min * (100Mi memory) +GPU: 3min * 1 / 1 = 3min * (1 nvidia.com/gpu) ``` ### Web/CLI reporting @@ -55,8 +55,3 @@ this context, resources like `memory` refer to the "base amounts". For example, `memory` means "amount of time a resource requested 1Gi of memory." If a container only uses 100Mi, each second it runs will only count as a tenth-second of `memory`. - -## Rounding Down - -For short running pods (<10s), the memory value may be 0s. This is because the default is `100Mi`, -but the denominator is `1Gi`.