From d686976ec8a7a6cedb6c1495eda17030be03a6e1 Mon Sep 17 00:00:00 2001 From: shishir-a412ed Date: Mon, 24 Nov 2014 16:20:18 -0500 Subject: [PATCH] Added description for 'docker run' command, -c/--cpu-shares flag Signed-off-by: Shishir Mahajan Upstream-commit: 41d3d7dc7289a0ed035a92f51c4444a91e1a37a5 Component: cli --- components/cli/docs/sources/reference/run.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/components/cli/docs/sources/reference/run.md b/components/cli/docs/sources/reference/run.md index 74a567c00b..e9ecfff442 100644 --- a/components/cli/docs/sources/reference/run.md +++ b/components/cli/docs/sources/reference/run.md @@ -302,6 +302,19 @@ get the same proportion of CPU cycles, but you can tell the kernel to give more shares of CPU time to one or more containers when you start them via Docker. +The flag `-c` or `--cpu-shares` with value 0 indicates that the running +container has access to all 1024 (default) CPU shares. However, this value +can be modified to run a container with a different priority or different +proportion of CPU cycles. + +E.g., If we start three {C0, C1, C2} containers with default values +(`-c` OR `--cpu-shares` = 0) and one {C3} with (`-c` or `--cpu-shares`=512) +then C0, C1, and C2 would have access to 100% CPU shares (1024) and C3 would +only have access to 50% CPU shares (512). In the context of a time-sliced OS +with time quantum set as 100 milliseconds, containers C0, C1, and C2 will run +for full-time quantum, and container C3 will run for half-time quantum i.e 50 +milliseconds. + ## Runtime privilege, Linux capabilities, and LXC configuration --cap-add: Add Linux capabilities