docker plugin add cpu share property

Bug #1439033 reported by LiangChen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Undecided
LiangChen

Bug Description

Docker API 1.8 and docker-py 0.3.0 support the cpu-shares parameter when
creating containers(docker run --cpu-shares=0).

By default, all containers run at the same priority and 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.

Reference:
http://docs.docker.com/reference/run/
http://docs.docker.com/reference/api/docker_remote_api_v1.8/
https://github.com/docker/docker-py/blob/master/docs/change_log.md

LiangChen (hs-chen)
Changed in heat:
assignee: nobody → LiangChen (hs-chen)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/169973

Changed in heat:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/169973
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=41437ff8a318dbdf22a5fabcddcee5fe8aa64102
Submitter: Jenkins
Branch: master

commit 41437ff8a318dbdf22a5fabcddcee5fe8aa64102
Author: LiangChen <email address hidden>
Date: Thu Apr 2 10:34:29 2015 +0800

    Docker plugin add cpu share property

    Docker API 1.8 and docker-py 0.3.0 support the cpu-shares parameter when
    creating containers(docker run --cpu-shares=0).

    By default, all containers run at the same priority and 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.

    Change-Id: Ic20cc56070c120ab46379aa42d5da6ac9425cae7
    Closes-bug: #1439033

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-1 → 5.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.