This section describes how to calculate resources (memory and CPU) required to run Eclipse Che.
Che architectural components
As illustrated in the High-level Che architecture article, Eclipse Che components are:
-
A central workspace controller: an always running service that manages users workspaces
-
Users workspaces: container-based IDEs that the controller stops when the user stops coding
Both the Che 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. For a detailed explanation of how Kubernetes manages container-resource requests and limits, see Kubernetes documentation.
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 |
|---|---|---|---|
Che |
che |
1 GiB |
512 MiB |
PostgreSQL |
postgres |
1 GiB |
512 MiB |
Keycloak |
keycloak |
2 GiB |
512 MiB |
Devfile registry |
che-devfile-registry |
256 MiB |
16 MiB |
Plug-in registry |
che-plugin-registry |
256 MiB |
16 MiB |
These default values are sufficient when the Che Workspace Controller manages a small amount of Che workspaces. For larger deployments, increase the memory limit. See the Advanced configurations options article for instructions on how to override the default requests and limits. For example, the hosted version of Che that runs on che.openshift.io uses 4 GiB.
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 10 active plug-ins requires more resources then 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.
-
Identify the workspace components explicitly specified in the
componentssection of the devfile. -
Identify the implicit workspace components:
-
Che 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. -
When Che is running in multi-user mode, it loads the
JWT Proxycomponent. The JWT Proxy is responsible for the authentication and authorization of the external communications of the workspace components.
-
-
Calculate the requirements for each component:
-
Default values:
The following table presents the default requirements for all workspace components. It also presents the corresponding Che server property to modify the defaults cluster-wide.
Table 2. Default requirements of workspace components by type Component types Che server property Default memory limit Default memory request chePluginche.workspace.sidecar.default_memory_limit_mb128 MiB
128 MiB
cheEditorche.workspace.sidecar.default_memory_limit_mb128 MiB
128 MiB
kubernetes,openshift,dockerimageche.workspace.default_memory_limit_mb,che.workspace.default_memory_request_mb1 Gi
512 MiB
JWT Proxyche.server.secure_exposer.jwtproxy.memory_limit128 MiB
128 MiB
-
Custom requirements for
chePluginsandcheEditorscomponents:-
Custom memory limit and request:
If present, the
memoryLimitattribute of thecontainerssection of themeta.yamlfile defines the memory limit of achePluginsorcheEditorscomponent. Che automatically sets the memory request to match the memory limit. There is no attribute in ameta.yamlfile to set the memory request.Example 1. ThechePluginche-incubator/typescript/latestmeta.yamlspec section:spec: containers: - image: docker.io/eclipse/che-remote-plugin-node:next name: vscode-typescript memoryLimit: 512MiIt results in a container with the following memory limit and request:
Memory limit
512 MiB
Memory request
512 MiB
How to find themeta.yamlfile ofchePluginCommunity plug-ins are available in the che-plugin-registry GitHub repository in folder
v3/plugins/${organization}/${name}/${version}/.For non-community or customized plug-ins, the
meta.yamlfiles are available on the local Kubernetes cluster at${pluginRegistryEndpoint}/v3/plugins/${organization}/${name}/${version}/meta.yaml.For example, on a local Minikube cluster, the URL for the
che-incubator/typescript/latest meta.yamlishttp://plugin-registry-che.192.168.64.78.nip.io/v3/plugins/che-incubator/typescript/latest/meta.yaml. -
Custom CPU limit and request:
Che does not set CPU limits and requests. The
LimitRangeKubernetes namespace may specify some defaults for CPU limits and requests. Kubernetes apply them to thechePlugincontainer.
-
-
Custom requirements for
dockerimagecomponentsIf present, the
memoryLimitattribute of the devfile defines the memory limit of adockerimagecontainer. Che set automatically the memory request to match the memory limit. There is no attribute in a devfile to set the memory request.- alias: maven type: dockerimage image: eclipse/maven-jdk8:latest memoryLimit: 1536M -
Custom requirements for
kubernetesoropenshiftcomponents:The referenced manifest may define the memory requirements and limits.
-
-
Add all requirements previously calculated.
A workspace example
This section describes a Che workspace example.
The following devfile defines the Che workspace:
apiVersion: 1.0.0
metadata:
generateName: guestbook-nodejs-sample-
projects:
- name: guestbook-nodejs-sample
source:
type: git
location: "https://github.com/l0rd/nodejs-sample"
components:
- type: chePlugin
id: che-incubator/typescript/latest
- type: kubernetes
alias: guestbook-frontend
reference: https://raw.githubusercontent.com/l0rd/nodejs-sample/master/kubernetes-manifests/guestbook-frontend.deployment.yaml
mountSources: true
entrypoints:
- command: ['sleep']
args: ['infinity']
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 |
128 MiB |
Workspace |
vscode-typescript ( |
512 MiB |
512 MiB |
Workspace |
frontend ( |
1 GiB |
512 MiB |
JWT Proxy |
verifier |
128 MiB |
128 MiB |
Total |
2.25 GiB |
1.75 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. -
Che is applying the defaults for the
kubernetescomponent type: a memory limit of 1 GiB and a memory request of 512 MiB. This is because thekubernetescomponent references aDeploymentmanifest that has a container specification with no resource limits or requests. -
The JWT container requires 128 MiB of memory.
Adding all together results in 1.75 GiB of memory requests with a 2.25 GiB limit.