Troubleshooting slow workspaces
Sometimes, workspaces can take a long time to start. Tuning can reduce this start time. Depending on the options, administrators or users can do the tuning.
This section includes several tuning options for starting workspaces faster or improving workspace runtime performance.
Improving workspace start time
- Caching images with Image Puller
-
Role: Administrator
When starting a workspace, Kubernetes pulls the images from the registry. A workspace can include many containers meaning that Kubernetes pulls Pod’s images (one per container). Depending on the size of the image and the bandwidth, it can take a long time.
Image Puller is a tool that can cache images on each of Kubernetes nodes. As such, pre-pulling images can improve start times. See Caching images for faster workspace start.
- Choosing better storage type
-
Role: Administrator and user
Every workspace has a shared volume attached. This volume stores the project files, so that when restarting a workspace, changes are still available. Depending on the storage, attach time can take up to a few minutes, and I/O can be slow.
- Installing offline
-
Role: Administrator
Components of Che are OCI images. Set up Eclipse Che in offline mode to reduce any extra download at runtime because everything needs to be available from the beginning. See Installing Che in a restricted environment on OpenShift.
- Reducing the number of public endpoints
-
Role: Administrator
For each endpoint, Kubernetes is creating Kubernetes Ingress or OpenShift Route objects. Depending on the underlying configuration, this creation can be slow.
To avoid this problem, reduce the exposure. For example, to automatically detect a new port listening inside containers and redirect traffic for the processes using a local IP address (
127.0.0.1
), Microsoft Visual Code - Open Source has three optional routes.By reducing the number of endpoints and checking endpoints of all plugins, workspace start can be faster.
Improving workspace runtime performance
- Providing enough CPU resources
-
Plugins consume CPU resources. For example, when a plugin provides IntelliSense features, adding more CPU resources can improve performance.
Ensure the CPU settings in the devfile definition,
devfile.yaml
, are correct:components: - name: tools container: image: quay.io/devfile/universal-developer-image:ubi8-latest cpuLimit: 4000m (1) cpuRequest: 1000m (2)
1 Specifies the CPU limit 2 Specifies the CPU request - Providing enough memory
-
Plug-ins consume CPU and memory resources. For example, when a plugin provides IntelliSense features, collecting data can consume all the memory allocated to the container.
Providing more memory to the container can increase performance. Ensure that memory settings in the devfile definition
devfile.yaml
file are correct.components: - name: tools container: image: quay.io/devfile/universal-developer-image:ubi8-latest memoryLimit: 6G (1) memoryRequest: 512Mi (2)
1 Specifies the memory limit 2 Specifies the memory request