[lxc-devel] [lxd/master] Documentation fixes

stgraber on Github lxc-bot at linuxcontainers.org
Thu Jan 4 19:03:28 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 301 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180104/db149c77/attachment.bin>
-------------- next part --------------
From 5c438fda3c9455a64c6ae48b78f375dafa727702 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 4 Jan 2018 13:39:10 -0500
Subject: [PATCH 1/2] doc/README: Update source build instructions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #4134

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 doc/index.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/index.md b/doc/index.md
index b907fd500..28201e834 100644
--- a/doc/index.md
+++ b/doc/index.md
@@ -65,7 +65,7 @@ export GOPATH=~/go
 And then download it as usual:
 
 ```bash
-go get github.com/lxc/lxd
+go get -d -v github.com/lxc/lxd/lxd
 cd $GOPATH/src/github.com/lxc/lxd
 make
 ```

From 62efb7b9e0af3068c1dba25e88619df3806e3ffe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 4 Jan 2018 14:02:50 -0500
Subject: [PATCH 2/2] doc/containers: Document CPU limits
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #4122

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 doc/containers.md | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/doc/containers.md b/doc/containers.md
index cfd23287b..5fc9c0491 100644
--- a/doc/containers.md
+++ b/doc/containers.md
@@ -104,6 +104,37 @@ The raw keys allow direct interaction with the backend features that LXD
 itself uses, setting those may very well break LXD in non-obvious ways
 and should whenever possible be avoided.
 
+### CPU limits
+The CPU limits are implemented through a mix of the `cpuset` and `cpu` CGroup controllers.
+
+`limits.cpu` results in CPU pinning through the `cpuset` controller.
+A set of CPUs (e.g. `1,2,3`) or a CPU range (e.g. `0-3`) can be specified.
+
+When a number of CPUs is specified instead (e.g. `4`), LXD will do
+dynamic load-balancing of all containers that aren't pinned to specific
+CPUs, trying to spread the load on the machine. Containers will then be
+re-balanced every time a container starts or stops as well as whenever a
+CPU is added to the system.
+
+To pin to a single CPU, you have to use the range syntax (e.g. `1-1`) to
+differentiate it from a number of CPUs.
+
+`limits.cpu.allowance` drives either the CFS scheduler quotas when
+passed a time constraint, or the generic CPU shares mechanism when
+passed a percentage value.
+
+The time constraint (e.g. `20ms/50ms`) is relative to one CPU worth of
+time, so to restrict to two CPUs worth of time, something like
+100ms/50ms should be used.
+
+When using a percentage value, the limit will only be applied when under
+load and will be used to calculate the scheduler priority for the
+container, relative to any other container which is using the same CPU(s).
+
+`limits.cpu.priority` is another knob which is used to compute that
+scheduler priority score when a number of containers sharing a set of
+CPUs have the same percentage of CPU assigned to them.
+
 # Devices configuration
 LXD will always provide the container with the basic devices which are required
 for a standard POSIX system to work. These aren't visible in container or


More information about the lxc-devel mailing list