Configuring storage types
Eclipse Che supports three types of storage with different capabilities:
Persistent storage allows storing user changes directly in the mounted Persistent Volume. User changes are kept safe by the Kubernetes or OpenShift infrastructure (storage backend) at the cost of slow I/O, especially with many small files. For example, Node.js projects tend to have many dependencies and the
node_modules/ directory is filled with thousands of small files.
|I/O speeds vary depending on the Storage Classes configured in the environment.|
Persistent storage is the default mode for new workspaces. To make this setting visible in workspace configuration, add the following to the devfile:
attributes: persistVolumes: 'true'
Ephemeral storage saves files to the
emptyDir volume. This volume is initially empty. When a Pod is removed from a node, the data in the
emptyDir volume is deleted forever. This means that all changes are lost on workspace stop or restart.
|To save the changes, commit and push to the remote before stopping an ephemeral workspace.|
Ephemeral mode provides faster I/O than persistent storage. To enable this storage type, add the following to workspace configuration:
attributes: persistVolumes: 'false'
Clone Eclipse Che
0 m 19 s
1 m 26 s
Generate 1000 random files
1 m 12 s
44 m 53 s
|Asynchronous storage is an experimental feature.|
Asynchronous storage is a combination of persistent and ephemeral modes. The initial workspace container mounts the
emptyDir volume. Then a backup is performed on workspace stop, and changes are restored on workspace start. Asynchronous storage provides fast I/O (similar to ephemeral mode), and workspace project changes are persisted.
Synchronization is performed by the rsync tool using the SSH protocol. When a workspace is configured with asynchronous storage, the workspace-data-sync plug-in is automatically added to the workspace configuration. The plug-in runs the
rsync command on workspace start to restore changes. When a workspace is stopped, it sends changes to the permanent storage.
For relatively small projects, the restore procedure is fast, and project source files are immediately available after Che-Theia is initialized. In case
rsync takes longer, the synchronization process is shown in the Che-Theia status-bar area. (Extension in Che-Theia repository).
Asynchronous mode has the following limitations:
To configure asynchronous storage for a workspace, add the following to workspace configuration:
attributes: asyncPersist: 'true' persistVolumes: 'false'
Use the fo;llowing two
che.properties to configure the default client values in Che dashboard:
Defines available values for storage types that clients like the dashboard propose for users during workspace creation or update. Available values:
async. Separate multiple values by commas. For example:
Defines the default value for storage type that clients like the dashboard propose for users during workspace creation or update. The
asyncvalue is not recommended as the default type because it is experimental. For example:
The Storage Type drop-down menu is available on the Create Custom Workspace page of the user dashboard:
Che can shut down the Asynchronous Storage Pod when not used for a configured period of time.
Use these configuration properties to adjust the behavior:
Defines the idle time after which the asynchronous storage Pod is stopped following the stopping of the last active workspace. The default value is 120 minutes.
Defines the frequency with which the asynchronous storage Pod is checked for idleness. The default value is 30 minutes.