Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate how to add possibility to limit CPU consumption by containers. #2630

Closed
garagatyi opened this issue Sep 28, 2016 · 2 comments
Closed
Assignees
Labels
kind/enhancement A feature request - must adhere to the feature request template.

Comments

@garagatyi
Copy link

Sometimes containers consumes too much CPU cycles which can lead to hanging of other container, Che master or even whole system. We should add possibility to limit CPU consumption by containers. In that case administrator of Che will be able to set some policies.
This issue assumes initial implementation and doesn't require full set of limitations supported by docker. After initial implementation we will have possibility to discover which limitation options are required by community.

@garagatyi garagatyi added kind/enhancement A feature request - must adhere to the feature request template. team/production labels Sep 28, 2016
@garagatyi garagatyi self-assigned this Sep 28, 2016
@garagatyi garagatyi added the status/open-for-dev An issue has had its specification reviewed and confirmed. Waiting for an engineer to take it. label Oct 4, 2016
@garagatyi
Copy link
Author

garagatyi commented Nov 22, 2016

we should take a look at container creation API https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#/create-a-container

I listed fields that can be helpful to limit CPU consumption below. We should investigate how to use them, how to configure these limits from product configuration and how they limits resources to address different profiles of server overloading.
CpuShares
CpuPeriod
CpuQuota
CpusetCpus

We can add some limitations into internal representation of environment org.eclipse.che.api.environment.server.model.CheServicesEnvironmentImpl and into implementations of infrastructure provisioner org.eclipse.che.api.environment.server.InfrastructureProvisioner.
Or we can add them into org.eclipse.che.plugin.docker.machine.MachineProviderImpl which represents docker machine creation.

@garagatyi garagatyi added status/in-progress This issue has been taken by an engineer and is under active development. and removed status/open-for-dev An issue has had its specification reviewed and confirmed. Waiting for an engineer to take it. labels Nov 25, 2016
@garagatyi
Copy link
Author

Here is a description of limits usage:
CpuShares allows to limit processors that will be used by container. Usage of this limit requires nodes with the same CPU configurations. This field allows us to deny usage of some core (processor), so processes that are not in a container can use this core even when other cores are 100% occupied.

CpuPeriod, CpuQuota allow to set upper limit of whole CPU consumption for each container. E.g. 25% of whole CPU is allowed to use by each container. But some amount of containers can occupy whole CPU, so other limitations are still needed. These fields allow us to distribute horse power of CPU between containers.

CgroupParent allow to set parent cgroup for all containers cgroups. Then user/admin can configure parent cgroup manually to set general limits to whole containers sub-system. But these limits have to be set by admin. This option also can be set in docker daemon configuration without configuring the product. On a system level admin can set CpuShares, CpuPeriod, CpuQuota, and other limitations to this cgroup including IO, network limits.

@garagatyi garagatyi changed the title Add possibility to limit CPU consumption by containers. Investigate how to add possibility to limit CPU consumption by containers. Nov 29, 2016
@skabashnyuk skabashnyuk removed the status/in-progress This issue has been taken by an engineer and is under active development. label Jan 24, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A feature request - must adhere to the feature request template.
Projects
None yet
Development

No branches or pull requests

3 participants