• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. User Guide 2.0
  4. Application Management
  5. Setting Container Specifications

Setting Container Specifications

CCE allows you to set specifications for added containers during application creation. You can set Request and Limit for CPU and memory resources used by each instance in an application.

NOTE:

If you select Request next to CPU and Memory and specify a value for Request, CCE schedules the application instance to a node that has the resources specified. If you deselect Request, CCE schedules an application instance to a random node. If you select Limit and specify a value for Limit, CCE limits the resources that can be used by the application instance based on the value specified. If you deselect Limit, CCE does not limit the resources that can be used by the application instance. The application or the node may be unavailable when the memory resources used by the instance exceed the memory that the node can allocate.

  • CPU quotas
    Table 1 CPU quotas

    Parameter

    Description

    Request

    Minimum number of CPU cores required by a container. A container is scheduled to a node on which the total number of available CPU cores is greater than or equal to the value specified by Request. This parameter does not limit the maximum number of CPU cores available for a container.

    Limit

    Maximum number of CPU cores available for a container.

    You are advised to configure the CPU quotas as follows: Actual number of CPU cores available for a node ‎≥ Sum of CPU Limits for all containers of the current instance ‎≥ Sum of CPU Limits for all containers of the current instance. For details about the actual number of CPU cores available for a node, go to Resource Management > Nodes and obtain the value from the Available CPUs (Cores) column of the corresponding node.

  • Memory quotas
    Table 2 Memory quotas

    Parameter

    Description

    Request

    Minimum amount of memory required by a container. A container is scheduled to a node on which the total amount of available memory is greater than or equal to the value specified by Request.

    Limit

    Maximum amount of memory available for a container. When the memory usage exceeds the configured limit, the instance may be restarted, which affects running of applications.

    You are advised to configure the memory quotas as follows: Actual amount of memory available for a node ‎≥ Sum of memory Limits for all containers of the current instance ‎≥ Sum of memory Limits for all containers of the current instance. For details about the actual amount of memory available for a node, go to Resource Management > Nodes and obtain the value from the Available Memory (GB) column of the corresponding node.

Configuration Example

In this example, a cluster contains a node with 4 CPU cores and 8-GB memory, and an application containing instance 1 and instance 2 has been deployed in the cluster, and the resource quotas are set for instance 1 and instance 2 as follows: {CPU Request, CPU Limit, Memory Request, Memory Limit} = {1 core, 2 cores, 2 GB, 2 GB}

The CPU usage and memory usage of the node are as follows:

  • Number of CPU cores available on the node = 4 core – (1 core requested by instance 1 + 1 core requested by instance 1) = 2 cores
  • Amount of memory available on the node = 8 GB – (2 GB requested by instance 1 + 2 GB core requested by instance 2) = 4 GB

Therefore, the node has 2 CPU cores and 4 GB memory available.