@@ -160,29 +160,90 @@ Use `deis run` to execute commands on the deployed application.
160160
161161## Limit Resource Usage
162162
163- Deis supports restricting memory and CPU shares of each [ Container] [ ] .
163+ Deis Workflow supports restricting memory and CPU shares of each process. Limits set on a per-process type are given to
164+ Kubernetes as both a request and limit. Which means you guarantee 'X' amount of resource for a process as well as limit
165+ the process from using more than 'X'.
166+
167+ If you set a limit that is out of range for your cluster, Kubernetes will be unable to schedule your application
168+ processes into the cluster.
169+
170+ Available units for memory are:
171+
172+ | Unit | Amount |
173+ | --- | --- |
174+ | B | Bytes |
175+ | K | KiB (Power of 2) |
176+ | M | MiB (Power of 2) |
177+ | G | GiB (Power of 2) |
178+
179+ !!! important
180+ The minimum memory limit allowed is 4MiB.
164181
165182Use ` deis limits:set ` to restrict memory by process type:
166183
167- $ deis limits:set web=512M
168- Applying limits... done, v3
184+ ```
185+ $ deis limits:set web=128M
186+ Applying limits... done
169187
170- === peachy-waxworks Limits
188+ === indoor-whitecap Limits
171189
172- --- Memory
173- web 512M
190+ --- Memory
191+ web 64M
174192
175- --- CPU
176- Unlimited
193+ --- CPU
194+ Unlimited
195+ ```
196+
197+ You can also use ` deis limits:set -c ` to restrict CPU shares. CPU shares are tracked in milli-cores. One CPU core is
198+ equivalent to 1000 milli-cores. To dedicate half a core to your process, you would need 500 milli-cores or 500m.
199+
200+ | Unit | Amount |
201+ | --- | --- |
202+ | 1000m | 1000 milli-cores == 100% CPU core |
203+ | 500m | 500 milli-cores == 50% CPU core |
204+ | 250m | 250 milli-cores == 25% CPU core |
205+ | 100m | 100 milli-cores == 10% CPU core |
206+
207+ ```
208+ $ deis limits:set web=250m -c
209+ Applying limits... done
177210
178- You can also use ` deis limits:set -c ` to restrict CPU shares.
179- CPU shares are on a scale of 0 to 1024, with 1024 being all CPU resources on the host.
211+ === indoor-whitecap Limits
212+
213+ --- Memory
214+ web 64M
215+
216+ --- CPU
217+ web 250m
218+ ```
219+
220+ You can verify the CPU and memory limits by inspecting the application process Pod with ` kubectl ` :
221+
222+ ```
223+ $ deis ps
224+ === indoor-whitecap Processes
225+ --- web:
226+ indoor-whitecap-v14-web-8slcj up (v14)
227+ $ kubectl --namespace=indoor-whitecap describe po indoor-whitecap-v14-web-8slcj
228+ Name: indoor-whitecap-v14-web-8slcj
229+ Containers:
230+ QoS Tier:
231+ cpu: Guaranteed
232+ memory: Guaranteed
233+ Limits:
234+ cpu: 250m
235+ memory: 64Mi
236+ Requests:
237+ memory: 64Mi
238+ cpu: 250m
239+ ```
180240
181241!!! important
182242 If you restrict resources to the point where containers do not start,
183243 the ` limits:set ` command will hang. If this happens, use CTRL-C
184244 to break out of ` limits:set ` and use ` limits:unset ` to revert.
185245
246+
186247## Share an Application
187248
188249Use ` deis perms:create ` to allow another Deis user to collaborate on your application.
0 commit comments