From 389c77b6ac7df37b0b2dbf2ecd79398ca20007bd Mon Sep 17 00:00:00 2001 From: Eric Tune Date: Fri, 8 Jul 2016 10:24:10 -0700 Subject: [PATCH] Describe CPU and Memory resources. --- docs/user-guide/compute-resources.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/user-guide/compute-resources.md b/docs/user-guide/compute-resources.md index bd8fd278f2..71fa9ca56e 100644 --- a/docs/user-guide/compute-resources.md +++ b/docs/user-guide/compute-resources.md @@ -40,6 +40,32 @@ about pod resource requests/limits. A *pod resource request/limit* for a partic type is the sum of the resource requests/limits of that type for each container in the pod, with unset values treated as zero (or equal to default values in some cluster configurations). +### Meaning of CPU +Limits and requests for `cpu` are measured in cpus. +One cpu, in Kubernetes, is equivalent to: + +- 1 AWS vCPU +- 1 GCP Core +- 1 Azure vCore +- 1 *Hyperthread* on a bare-metal Intel processor with Hyperthreading + +Fractional requests are allowed. A container with `spec.container[].resources.requests.cpu` of `0.5` will +be guaranteed half as much CPU as one that asks for `1`. The expression `0.1` is equivalent to the expression +`100m`, which can be read as "one hundred millicpu" (some may say "one hundred millicores", and this is understood +to mean the same thing when talking about Kubernetes). A request with a decimal point, like `0.1` is converted to +`100m` by the API, and precision finer than `1m` is not allowed. For this reason, the form `100m` may be preferred. + +CPU is always requested as an absolute quantity, never as a relative quantity; 0.1 is the same amount of cpu on a single +core, dual core, or 48 core machine. + +# Meaning of Memory + +Limits and requests for `memory` are measured in bytes. +Memory can be expressed a plain integer or as fixed-point integers with one of these SI suffixes (E, P, T, G, M, K) +or their power-of-two equivalents (Ei, Pi, Ti, Gi, Mi, Ki). For example, the following represent roughly the same value: +`128974848`, `129e6`, `129M` , `123Mi`. + +### Example The following pod has two containers. Each has a request of 0.25 core of cpu and 64MiB (220 bytes) of memory and a limit of 0.5 core of cpu and 128MiB of memory. The pod can be said to have a request of 0.5 core and 128 MiB of memory and a limit of 1 core and 256MiB of