Previous page

Next page

Locate page in Contents

Print this page

Creating a Local Cache

Note: Unlike directories used in most Parallels Cloud Storage configuration steps, the local cache on SSD is a file. Make sure you supply correct paths to the pstorage-mount -C command and the cache parameter in the corresponding /etc/fstab entry.

You create a local cache when mounting a Parallels Cloud Storage cluster to a client. This process includes two steps:

  1. If required, preparing the SSD as described in Preparing Disks for Parallels Cloud Storage .
  2. Using the pstorage-mount command to mount the cluster and create the cache.

For example, to make a 64 GB local cache for the pcs1 cluster and store it in the file /mnt/ssd/pstorage-cache-for-cluster-pcs1 , you can execute the following command:

# pstorage-mount -c pcs1 /pstorage/pcs1 -C /mnt/ssd/pstorage-cache-for-cluster-pcs1 -R 64000

If you do not specify the cluster size, pstorage-mount will automatically calculate it using the following formula:

SSD_free_space - 10 GB - SSD_total_space /10

So if the total size of your SSD drive is 100 GB and it has 80 GB of free space, the command will create the local cache with the size of 60 GB.

Notes:

1. The local cache is not created if the resulting cache size is less than 1 GB.

2. If you also plan to configure the SSD drive for write journaling, first create the journal to reserve disk space for it and then create a local cache. For more information, see Configuring SSD Drives for Write Journaling .

Configuring Automatic Cache Creation

You can automate the procedure of creating a local cache so that it is automatically created each time you start the client. To do this, add the information about the cache to the /etc/fstab file on the client.

For example, to (1) have an automatically created cache with the name of pstorage-cache-for-cluster-pcs1 and size of 64 GB, (2) store it in the /mnt/ssd directory on the client, and (3) disable checksumming for data in the local cache, specify the following parameters in /etc/fstab and separate them by commas:

  • cache= N . Sets the full path to the local cache file.
  • cachesize= N . Specifies the size of the local cache, in megabytes.
  • cachechksum=n . Disables checksumming for your data; by default, data checksumming is enabled.

Once you set these parameters, your fstab file should look like the following:

pstorage://pcs1 /pstorage/pcs1 fuse.pstorage cache=/mnt/ssd/ pstorage-cache-for-cluster-pcs1 ,cachesize=64000,cachechksum=n 0 0

For more information on options you can use to set up and configure a local cache, see the pstorage-mount man pages.

Disabling Checksumming

To provide better reliability and integrity of your data, the pstorage-mount command automatically enables checksumming for the data in the local cache. If necessary, you can disable data checksumming by passing the -S option to pstorage-mount :

# pstorage-mount -c pcs1 /pstorage/pcs1 -C /mnt/ssd/pstorage-cache-for-cluster-pcs1 -R 64000 -S

Querying Cache Information

To check whether the cache for a mounted cluster is active and view its current parameters, you can use this command:

# cat /pstorage/pcs1/.pstorage.info/read_cache_info

path : /mnt/ssd/pstorage-cache-for-cluster-pcs1

main size (Mb) : 56000

boot size (Mb) : 8000

block size (Kb) : 64

checksum : enabled

If the cache does not exist, the command output is empty. Otherwise, the command prints:

  • path to the cache file
  • size of the main and boot caches
  • block size
  • checksum status