Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
docs(limits-cmd): accept new limits:set value type
Browse files Browse the repository at this point in the history
Accept new cli format limits:set web=500m/2000m
Value is map to requests/limits parameter in Kubernetes resource management.
See workflow#562
  • Loading branch information
zinuzoid committed Oct 23, 2016
1 parent ab9f08e commit 6a99e4d
Showing 1 changed file with 37 additions and 13 deletions.
50 changes: 37 additions & 13 deletions src/applications/managing-resource-limits.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
## Managing Application Resource Limits

Deis Workflow supports restricting memory and CPU shares of each process. Limits set on a per-process type are given to
Kubernetes as both a request and limit. Which means you guarantee 'X' amount of resource for a process as well as limit
the process from using more than 'X'.
Deis Workflow supports restricting memory and CPU shares of each process. Requests/Limits set on a per-process type are given to
Kubernetes as a requests and limits. Which means you guarantee \<requests\> amount of resource for a process as well as limit
the process from using more than \<limits\>.
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`.

## Limiting Memory

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

Available units for memory are:
Expand All @@ -21,7 +22,7 @@ Available units for memory are:
!!! important
The minimum memory limit allowed is 4MiB.

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

```
$ deis limits:set web=64M
Expand All @@ -32,6 +33,17 @@ Applying limits... done
--- Memory
web 64M
--- CPU
Unlimited
$ deis limits:set cmd=32M/64M
Applying limits... done
=== outdoor-whitecap Limits
--- Memory
cmd 32M/64M
--- CPU
Unlimited
```
Expand All @@ -53,8 +65,9 @@ Unlimited

## Limiting CPU

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

| Unit | Amount |
| --- | --- |
Expand All @@ -74,6 +87,17 @@ web 64M
--- CPU
web 250m
$ deis limits:set web=1500m/2000m --cpu
Applying limits... done
=== indoor-whitecap Limits
--- Memory
web 64M
--- CPU
web 1500m/2000m
```

You can verify the CPU and memory limits by inspecting the application process Pod with `kubectl`:
Expand All @@ -87,14 +111,14 @@ $ kubectl --namespace=indoor-whitecap describe po indoor-whitecap-v14-web-8slcj
Name: indoor-whitecap-v14-web-8slcj
Containers:
QoS Tier:
cpu: Guaranteed
memory: Guaranteed
cpu: Guaranteed
memory: Guaranteed
Limits:
cpu: 250m
memory: 64Mi
cpu: 2000m
memory: 64Mi
Requests:
memory: 64Mi
cpu: 250m
memory: 64Mi
cpu: 1500m
```

!!! important
Expand Down

0 comments on commit 6a99e4d

Please sign in to comment.