Configuring storage types
Eclipse Che supports three types of storage with different capabilities:
-
Persistent
-
Ephemeral
-
Asynchronous
Persistent storage
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
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'
Command | Ephemeral | Persitent |
---|---|---|
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
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'
Configuring storage type defaults for Che dashboard
Use the following two che.properties
to configure the default client values in Che dashboard:
che.workspace.storage.available_types
-
Defines available values for storage types that clients like the dashboard propose for users during workspace creation or update. Available values:
persistent
,ephemeral
, andasync
. Separate multiple values by commas. For example:che.workspace.storage.available_types=persistent,ephemeral,async
che.workspace.storage.preferred_type
-
Defines the default value for storage type that clients like the dashboard propose for users during workspace creation. The
async
value is not recommended as the default type because it is experimental. For example:che.workspace.storage.preferred_type=persistent
Then users are able to configure Storage Type on the Create Custom Workspace tab on Che dashboard during workspace creation. Storage type for existing workspace can be configured in on Overview tab of the workspace details.
Idling asynchronous storage Pods
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:
che.infra.kubernetes.async.storage.shutdown_timeout_min
-
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.
che.infra.kubernetes.async.storage.shutdown_check_period_min
-
Defines the frequency with which the asynchronous storage Pod is checked for idleness. The default value is 30 minutes.