All Products
Search
Document Center

Cloud Backup:Use the cache feature to accelerate data backup

Last Updated:Nov 22, 2024

The cache feature is enabled by default on a Cloud Backup client for on-premises file backup. The cache feature is used to accelerate file backup and exchange the memory consumption of file backup in disk space, without affecting data restoration on a local or remote host. This topic describes how to optimize the settings of the cache feature.

Prerequisites

A Cloud Backup client is installed for on-premises file backup. The client version is 1.5.0 or later. For more information, see Download and activate a Cloud Backup client.

Background information

The cache feature caches data entry IDs and metadata to reduce network requests initiated during data backup, accelerating the data backup process. You can disable this feature or optimize its settings on the backup source.

Procedure

You can perform the following steps to create a cache configuration file. You can also disable the cache feature or optimize its settings by using the configuration file. This file is optional. If you do not create such a file, the default settings of the cache feature are used. The backup acceleration is not affected.

  1. Log on to the on-premises server or virtual machine (VM) whose files you want to back up.

  2. Find and open the installation folder of the Cloud Backup client.

    You can find the installation path based on the following default installation paths:

    • Old Cloud Backup client

      Linux: /opt/alibabacloud/hbr

      Windows: C:\Program Files\Aliyun Hybrid Backup Service

    • New Cloud Backup client

      Linux: /opt/alibabacloud/hbrclient

      Windows: C:\Program Files\Aliyun Hybrid Backup Service Client

  3. In a subdirectory of the client folder, create a file named hbr.config, and add data entry ID and metadata caches to the file.

    Note

    The hbr.config file must be at the same directory level as the ids file.

    The following example shows the configurations of the hbr.config file:

    disable_blob_cache = false
    max_blob_cache_weight = 0.15
    cache_prefix = D:\CacheFolder
    max_retain_count = 16 
    
    disable_file_cache = false
    file_cache_max_size_hint = 32GB  
    file_cache_disk_free_space_hint = 1GB
    file_cache_max_retain_count = 2

    Parameter

    Description

    disable_blob_cache

    Specifies whether to cache data entry IDs. Valid values:

    • true: does not cache data entry IDs.

    • false: caches data entry IDs.

    max_blob_cache_weight

    The maximum system memory that can be used by the cache for data entry IDs. Default value: 0.15. The value indicates 15% of the total system memory. The value must be between 0 and 1.

    cache_prefix

    The path in which the cached data entry IDs are stored. The value must be an absolute path.

    max_retain_count

    The maximum number of cached data entry IDs.

    disable_file_cache

    Specifies whether to cache metadata. Valid values:

    • true: does not cache metadata.

    • false: caches metadata.

    file_cache_max_size_hint

    The maximum disk space occupied by a file cache. Default value: 32 GB. If the disk space occupied by a file cache exceeds this value, the file backup fails and the system prompts that the file cache space is insufficient. In this case, set the file_cache_max_size_hint parameter to a larger value. For example, the backup cache of 10 million files occupies about 1.5 GB of disk space each time. The specific disk space occupied is related to the number of source files, the total data volume, and the full path length. A new cache space is generated during the backup. The formula to calculate the space to be reserved for the disk is: 1.5 GB × (file_cache_max_retain_count + 1) + file_cache_disk_free_space_hint.

    Then, under the default configuration, the disk space to be reserved for 10 million files backup is:

    1.5 GB × (2 + 1) + 1 = 5.5 GB.

    Note: If more than 10 million files exist, you can calculate the reserved disk space based on the multiples of the number of files.

    Note

    This parameter is available for a Cloud Backup client for file backup whose version is 2.13.1 or later.

    file_cache_disk_free_space_hint

    The available space of the disk where a file cache is located. Default value: 1 GB. If the available disk space is less than this value, the file backup fails and the system prompts that the file cache space is insufficient. In this case, adjust the cache space as required.

    Note

    This parameter is available for a Cloud Backup client for file backup whose version is 2.13.1 or later.

    file_cache_max_retain_count

    The number of file caches reserved for each backup path. Default value: 2. For example, if the value is set to 2, the caches of the last two backups are retained locally. If the latest backup is deleted, the second last backup can still be found.

    Note

    This parameter is available for a Cloud Backup client for file backup whose version is 2.13.1 or later.

    Important
    • The parameter settings take effect immediately after you save the hbr.config file. You do not need to restart the server or VM.

    • The parameter settings are applied only to subsequent backup jobs. You cannot accelerate the existing backup jobs by caching data entry IDs and metadata.