이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 2. Calculating CodeReady Workspaces resource requirements
This section describes how to calculate resources, such as memory and CPU, required to run Red Hat CodeReady Workspaces.
Both the CodeReady Workspaces central controller and user workspaces consist of a set of containers. Those containers contribute to the resources consumption in terms of CPU and RAM limits and requests.
2.1. Controller requirements 링크 복사링크가 클립보드에 복사되었습니다!
The Workspace Controller consists of a set of five services running in five distinct containers. The following table presents the default resource requirements of each of these services.
| Pod | Container name | Default memory limit | Default memory request |
|---|---|---|---|
| CodeReady Workspaces Server and Dashboard | che | 1 GiB | 512 MiB |
| PostgreSQL |
| 1 GiB | 512 MiB |
| RH-SSO |
| 2 GiB | 512 MiB |
| Devfile registry |
| 256 MiB | 16 MiB |
| Plug-in registry |
| 256 MiB | 16 MiB |
These default values are sufficient when the CodeReady Workspaces Workspace Controller manages a small amount of CodeReady Workspaces workspaces. For larger deployments, increase the memory limit. See the Advanced configuration options for the CodeReady Workspaces server component article for instructions on how to override the default requests and limits. For example, the Eclipse Che hosted by Red Hat that runs on https://workspaces.openshift.com uses 1 GB of memory.
Additional resources
2.2. Workspaces requirements 링크 복사링크가 클립보드에 복사되었습니다!
This section describes how to calculate the resources required for a workspace. It is the sum of the resources required for each component of this workspace.
These examples demonstrate the necessity of a proper calculation:
- A workspace with ten active plug-ins requires more resources than the same workspace with fewer plug-ins.
- A standard Java workspace requires more resources than a standard Node.js workspace because running builds, tests, and application debugging requires more resources.
Procedure
-
Identify the workspace components explicitly specified in the
componentssection of the Authoring a devfile 2.0.0. Identify the implicit workspace components:
-
CodeReady Workspaces implicitly loads the default
cheEditor:che-theia, and thechePluginthat allows commands execution:che-machine-exec-plugin. To change the default editor, add acheEditorcomponent section in the devfile. - The JWT Proxy component is responsible for the authentication and authorization of the external communications of the workspace components.
-
CodeReady Workspaces implicitly loads the default
Calculate the requirements for each component:
Default values:
The following table displays the default requirements for all workspace components, and the corresponding CodeReady Workspaces server properties. Use the CodeReady Workspaces server properties to modify the defaults cluster-wide.
Expand Table 2.2. Default requirements of workspace components by type Component types CodeReady Workspaces server property Default memory limit Default memory request chePluginche.workspace.sidecar.default_memory_limit_mb128 MiB
64 MiB
cheEditorche.workspace.sidecar.default_memory_limit_mb128 MiB
64 MiB
kubernetes,openshift,dockerimageche.workspace.default_memory_limit_mb,che.workspace.default_memory_request_mb1 Gi
200 MiB
JWT Proxyche.server.secure_exposer.jwtproxy.memory_limit,che.server.secure_exposer.jwtproxy.memory_request128 MiB
15 MiB
Custom requirements for
chePluginsandcheEditorscomponents:Custom memory limit and request:
Define the
memoryLimitandmemoryRequestattributes of thecontainerssection of themeta.yamlfile to configure the memory limit of thechePluginsorcheEditorscomponents. CodeReady Workspaces automatically sets the memory request to match the memory limit if it is not specified explicitly.Example 2.1. The
chePluginche-incubator/typescript/latestmeta.yamlspec section:Copy to Clipboard Copied! Toggle word wrap Toggle overflow This results in a container with the following memory limit and request:
Expand Memory limit
512 MiB
Memory request
256 MiB
NoteFor IBM Power Systems (ppc64le), the memory limit for some plugins has been increased by up to 1.5G to allow pods sufficient RAM to run. For example, on IBM Power Systems (ppc64le), the Theia editor pod requires 2G; the OpenShift connector pod requires 2.5G. For AMD64 and Intel 64 (x86_64) and IBM Z (s390x), memory requirements remain lower at 512M and 1500M respectively. However, some devfiles may still be configured to set the lower limit valid for AMD64 and Intel 64 (x86_64) and IBM Z (s390x), so to work around this, edit devfiles for workspaces that are crashing to increase the default memoryLimit by at least 1 - 1.5 GB.
NoteHow to find the
meta.yamlfile ofchePluginCommunity plug-ins are available in the CodeReady Workspaces plug-ins registry repository in folder
v3/plugins/${organization}/${name}/${version}/.For non-community or customized plug-ins, the
meta.yamlfiles are available on the local OpenShift cluster at${pluginRegistryEndpoint}/v3/plugins/${organization}/${name}/${version}/meta.yaml.Custom CPU limit and request:
CodeReady Workspaces does not set CPU limits and requests by default. However, it is possible to configure CPU limits for the
chePluginandcheEditortypes in themeta.yamlfile or in the devfile in the same way as it done for memory limits.Example 2.2. The
chePluginche-incubator/typescript/latestmeta.yamlspec section:Copy to Clipboard Copied! Toggle word wrap Toggle overflow It results in a container with the following CPU limit and request:
Expand CPU limit
2 cores
CPU request
0.5 cores
To set CPU limits and requests globally, use the following dedicated environment variables:
|
|
|
|
|
|
See also Advanced configuration options for the CodeReady Workspaces server component.
Note that the LimitRange object of the OpenShift project may specify defaults for CPU limits and requests set by cluster administrators. To prevent start errors due to resources overrun, limits on application or workspace levels must comply with those settings.
Custom requirements for
dockerimagecomponentsDefine the
memoryLimitandmemoryRequestattributes of the devfile to configure the memory limit of adockerimagecontainer. CodeReady Workspaces automatically sets the memory request to match the memory limit if it is not specified explicitly.- alias: maven type: dockerimage image: eclipse/maven-jdk8:latest memoryLimit: 1536M- alias: maven type: dockerimage image: eclipse/maven-jdk8:latest memoryLimit: 1536MCopy to Clipboard Copied! Toggle word wrap Toggle overflow Custom requirements for
kubernetesoropenshiftcomponents:The referenced manifest may define the memory requirements and limits.
- Add all previously calculated requirements.
Additional resources
2.3. A workspace example 링크 복사링크가 클립보드에 복사되었습니다!
This section describes a CodeReady Workspaces workspace example.
The following devfile defines the CodeReady Workspaces workspace:
This table provides the memory requirements for each workspace component:
| Pod | Container name | Default memory limit | Default memory request |
|---|---|---|---|
| Workspace |
theia-ide (default | 512 MiB | 512 MiB |
| Workspace |
machine-exec (default | 128 MiB | 32 MiB |
| Workspace |
vscode-typescript ( | 512 MiB | 512 MiB |
| Workspace |
nodejs ( | 1 GiB | 512 MiB |
| JWT Proxy | verifier | 128 MiB | 128 MiB |
| Total | 2.25 GiB | 1.38 GiB | |
-
The
theia-ideandmachine-execcomponents are implicitly added to the workspace, even when not included in the devfile. -
The resources required by
machine-execare the default forchePlugin. -
The resources for
theia-ideare specifically set in thecheEditormeta.yamlto 512 MiB asmemoryLimit. -
The Typescript VS Code extension has also overridden the default memory limits. In its
meta.yamlfile, the limits are explicitly specified to 512 MiB. - CodeReady Workspaces is applying the defaults for the dockerimage component type: a memory limit of 1 GiB and a memory request of 512 MiB.
- The JWT container requires 128 MiB of memory.
Adding all together results in 1.38 GiB of memory requests with a 2.25 GiB limit.
Additional resources