Skip to content

Commit 021e732

Browse files
author
Gabriel Monroy
committed
docs(using-deis): add missing sections on limits and tags
1 parent e44aa3d commit 021e732

1 file changed

Lines changed: 58 additions & 9 deletions

File tree

docs/using_deis/manage-application.rst

Lines changed: 58 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ Use ``deis scale`` to control the number of :ref:`Containers <container>` that p
2020
2121
=== peachy-waxworks Processes
2222
23-
--- web: `java -cp target/classes:target/dependency/* HelloWorld`
24-
web.1 up 2013-12-03T00:00:25.836Z (dev-runtime-1)
25-
web.2 up 2013-12-03T00:30:10.934Z (dev-runtime-1)
26-
web.3 up 2013-12-03T00:30:10.950Z (dev-runtime-1)
27-
web.4 up 2013-12-03T00:30:10.963Z (dev-runtime-1)
28-
web.5 up 2013-12-03T00:30:10.978Z (dev-runtime-1)
29-
web.6 up 2013-12-03T00:30:10.993Z (dev-runtime-1)
30-
web.7 up 2013-12-03T00:30:11.010Z (dev-runtime-1)
31-
web.8 up 2013-12-03T00:30:11.027Z (dev-runtime-1)
23+
--- web:
24+
web.1 up (v2)
25+
web.2 up (v2)
26+
web.3 up (v2)
27+
web.4 up (v2)
28+
web.5 up (v2)
29+
web.6 up (v2)
30+
web.7 up (v2)
31+
web.8 up (v2)
3232
3333
Scaling is managed by process types like ``web`` or ``worker`` defined in a
3434
`Procfile`_ in the root of your application repository.
@@ -102,9 +102,58 @@ Use ``deis logs`` to view the log output from your deployed application.
102102
Dec 3 00:30:31 ip-10-250-15-201 peachy-waxworks[web.7]: INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:10007
103103
Dec 3 00:30:31 ip-10-250-15-201 peachy-waxworks[web.8]: INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:10008
104104
105+
Limit the Application
106+
---------------------
107+
Deis supports restricting memory and CPU shares of each :ref:`Container`.
108+
109+
Use ``deis limits:set`` to restrict memory by process type:
110+
111+
.. code-block:: console
112+
113+
$ deis limits:set web=512M
114+
Applying limits... done, v3
115+
116+
=== peachy-waxworks Limits
117+
118+
--- Memory
119+
web 512M
120+
121+
--- CPU
122+
Unlimited
123+
124+
You can also use ``deis limits:set -c`` to restrict CPU shares.
125+
CPU shares are on a scale of 0 to 1024, with 1024 being all CPU resources on the host.
126+
127+
.. important::
128+
129+
If you restrict resources to the point where containers do not start,
130+
the limits:set command will hang. If this happens, use CTRL-C
131+
to break out of limits:set and use limits:unset to revert.
132+
133+
Isolate the Application
134+
-----------------------
135+
Deis supports isolating applications onto a set of hosts using ``tags``.
136+
137+
.. note::
138+
139+
In order to use tags, you must first launch your hosts with
140+
the proper key/value tag information. If you do not, tag commands will fail.
141+
Learn more by reading the `machine metadata`_ section of Fleet documentation.
142+
143+
Once your hosts are configured with appropriate key/value metadata, use
144+
``deis tags:set`` to restrict the application to those hosts:
145+
146+
.. code-block:: console
147+
148+
$ deis tags:set environ=prod
149+
Applying tags... done, v4
150+
151+
environ prod
152+
105153
.. _`store config in environment variables`: http://12factor.net/config
106154
.. _`decoupled from the application`: http://12factor.net/backing-services
107155
.. _`scale out via the process model`: http://12factor.net/concurrency
108156
.. _`treat logs as event streams`: http://12factor.net/logs
109157
.. _`use one-off processes for admin tasks`: http://12factor.net/admin-processes
110158
.. _`Procfile`: http://ddollar.github.io/foreman/#PROCFILE
159+
.. _`machine metadata`: https://coreos.com/docs/launching-containers/launching/fleet-unit-files/#user-defined-requirements

0 commit comments

Comments
 (0)