Skip to content

Commit 6a99e4d

Browse files
committed
docs(limits-cmd): accept new limits:set value type
Accept new cli format limits:set web=500m/2000m Value is map to requests/limits parameter in Kubernetes resource management. See workflow#562
1 parent ab9f08e commit 6a99e4d

1 file changed

Lines changed: 37 additions & 13 deletions

File tree

src/applications/managing-resource-limits.md

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
## Managing Application Resource Limits
22

3-
Deis Workflow supports restricting memory and CPU shares of each process. Limits set on a per-process type are given to
4-
Kubernetes as both a request and limit. Which means you guarantee 'X' amount of resource for a process as well as limit
5-
the process from using more than 'X'.
3+
Deis Workflow supports restricting memory and CPU shares of each process. Requests/Limits set on a per-process type are given to
4+
Kubernetes as a requests and limits. Which means you guarantee \<requests\> amount of resource for a process as well as limit
5+
the process from using more than \<limits\>.
6+
By default, Kubernetes will set \<requests\> equal to \<limit\> if we don't explicitly set \<requests\> value. Please keep in mind that `0 <= requests <= limits`.
67

78
## Limiting Memory
89

9-
If you set a limit that is out of range for your cluster, Kubernetes will be unable to schedule your application
10+
If you set a requests/limits that is out of range for your cluster, Kubernetes will be unable to schedule your application
1011
processes into the cluster!
1112

1213
Available units for memory are:
@@ -21,7 +22,7 @@ Available units for memory are:
2122
!!! important
2223
The minimum memory limit allowed is 4MiB.
2324

24-
Use `deis limits:set` to restrict memory by process type:
25+
Use `deis limits:set <type>=<value>` to restrict memory by process type, where value can be \<limit\> or \<request\>/\<limit\> format :
2526

2627
```
2728
$ deis limits:set web=64M
@@ -32,6 +33,17 @@ Applying limits... done
3233
--- Memory
3334
web 64M
3435
36+
--- CPU
37+
Unlimited
38+
39+
$ deis limits:set cmd=32M/64M
40+
Applying limits... done
41+
42+
=== outdoor-whitecap Limits
43+
44+
--- Memory
45+
cmd 32M/64M
46+
3547
--- CPU
3648
Unlimited
3749
```
@@ -53,8 +65,9 @@ Unlimited
5365

5466
## Limiting CPU
5567

56-
You can also use `deis limits:set --cpu` to restrict CPU shares. CPU shares are tracked in milli-cores. One CPU core is
57-
equivalent to 1000 milli-cores. To dedicate half a core to your process, you would need 500 milli-cores or 500m.
68+
You can also use `deis limits:set <type>=<value> --cpu` to restrict CPU shares, where value can be \<limit\> or
69+
\<request\>/\<limit\> format. CPU shares are tracked in milli-cores. One CPU core is equivalent to 1000 milli-cores.
70+
To dedicate half a core to your process, you would need 500 milli-cores or 500m.
5871

5972
| Unit | Amount |
6073
| --- | --- |
@@ -74,6 +87,17 @@ web 64M
7487
7588
--- CPU
7689
web 250m
90+
91+
$ deis limits:set web=1500m/2000m --cpu
92+
Applying limits... done
93+
94+
=== indoor-whitecap Limits
95+
96+
--- Memory
97+
web 64M
98+
99+
--- CPU
100+
web 1500m/2000m
77101
```
78102

79103
You can verify the CPU and memory limits by inspecting the application process Pod with `kubectl`:
@@ -87,14 +111,14 @@ $ kubectl --namespace=indoor-whitecap describe po indoor-whitecap-v14-web-8slcj
87111
Name: indoor-whitecap-v14-web-8slcj
88112
Containers:
89113
QoS Tier:
90-
cpu: Guaranteed
91-
memory: Guaranteed
114+
cpu: Guaranteed
115+
memory: Guaranteed
92116
Limits:
93-
cpu: 250m
94-
memory: 64Mi
117+
cpu: 2000m
118+
memory: 64Mi
95119
Requests:
96-
memory: 64Mi
97-
cpu: 250m
120+
memory: 64Mi
121+
cpu: 1500m
98122
```
99123

100124
!!! important

0 commit comments

Comments
 (0)