Updated on 2024-07-11 GMT+08:00

Creating a Workload Replay Task

Scenarios

A workload replay task simulates the service load of the source database on the destination database so you can evaluate the effectiveness and performance of the destination database. This function applies to the following scenarios:

  • Function testing: By creating a workload replay task, you can evaluate how the service load of the source database runs on the destination database.
  • Peak load testing: By specifying the replay thread and speed, you can simulate the peak service load of the source database and analyze the stability of the destination database when workloads increase sharply.

Process

Figure 1 Workload replay process

This section describes how to create a workload replay task from RDS for MySQL to RDS for MySQL. To configure other storage engines, you can refer to the following procedures.

Procedure

  1. On the Workload Replay Management page, click Create Workload Replay Task.
  2. On the Create Replay Instance page, select a region and project, specify the task name, description, and the replay instance details, and click Create Now.

    • Task information description
      Figure 2 Workload replay task information
      Table 1 Task information

      Parameter

      Description

      Region

      The region where the replay instance is deployed. You can change the region.

      Project

      The project corresponds to the current region and can be changed.

      Task Name

      The task name must start with a letter and consist of 4 to 50 characters. It can contain only letters, digits, hyphens (-), and underscores (_).

      Description

      The description can contain up to 256 characters and cannot contain special characters !=<>&'\"

    • Replay instance information
      Figure 3 Replay instance information
      Table 2 Replay instance settings

      Parameter

      Description

      Data Flow

      Select Current cloud.

      • Current cloud refers to the workload replay scenario where both source and destination databases are Huawei Cloud DB instances.
      • To the cloud refers to the workload replay scenario where the destination database is a Huawei Cloud DB instance and data needs to be transferred.

      Source DB Engine

      Select MySQL.

      Workload File Source

      Specifies where the workload file in the source database is from.

      • Download from Huawei Cloud APIs: Obtain audit log files through the API corresponding to Huawei Cloud services.
      • Download from Huawei Cloud OBS: Obtain workload files from Huawei Cloud OBS buckets.

      Destination DB Engine

      Select MySQL.

      Network Type

      Public network is used as an example.

      Available options: Public network, VPC, VPN or Direct Connect

      Destination DB Instance

      The RDS for MySQL DB instance you created. Ensure that baseline data has been developed in the destination database.

      Replay Instance Subnet

      Select the subnet where the replay instance is located. You can also click View Subnets to go to the network console to view the subnet where the instance resides.

      By default, the DRS instance and the destination DB instance are in the same subnet. You need to select the subnet where the DRS instance resides, and there are available IP addresses for the subnet. To ensure that the replay instance can be successfully created, only subnets with DHCP enabled are displayed.

      Specify EIP

      This parameter is available when you select Public network for Network Type. Select an EIP to be bound to the DRS instance. DRS will automatically bind the specified EIP to the DRS instance and unbind the EIP after the task is complete.

      For details about the data transfer fee generated using a public network, see EIP Price Calculator.

    • AZ
      Figure 4 AZ
      Table 3 Task AZ

      Parameter

      Description

      AZ

      Select the AZ where you want to create the DRS task. Selecting the one housing the source or destination database can provide better performance.

    • Enterprise Project and Tags
      Figure 5 Enterprise Project and Tags
      Table 4 Enterprise Project and Tags

      Parameter

      Description

      Enterprise Project

      An enterprise project you would like to use to centrally manage your cloud resources and members. Select an enterprise project from the drop-down list. The default project is default.

      For more information about enterprise project, see Enterprise Management User Guide.

      To customize an enterprise project, click Enterprise in the upper right corner of the console. The Enterprise Project Management Service page is displayed. For details, see Creating an Enterprise Project in Enterprise Management User Guide.

      Tags

      • This setting is optional. Adding tags helps you better identify and manage your tasks. Each task can have up to 20 tags.
      • If your organization has configured tag policies for DRS, add tags to tasks based on the policies. If a tag does not comply with the policies, task creation may fail. Contact your organization administrator to learn more about tag policies.
      • After a task is created, you can view its tag details on the Tags tab. For details, see Tag Management.

    If a task fails to be created, DRS retains the task for three days by default. After three days, the task automatically stops.

  3. After the replay instance is created, on the Configure Source and Destination Databases page, specify parameters in Source Database, Destination Database, and Task Settings. Then, click Test Connection for the destination database to check whether the destination database has been connected to the replay instance. After the connection test is successful, click Next.

    • Source database information when Download from Huawei Cloud APIs is selected for Workload File Source
      Figure 6 Source database information

      Table 5 Source database settings

      Parameter

      Description

      Workload File Source

      Specifies where the workload file in the source database is from.

      DB Instance Name

      Select an RDS for MySQL DB instance for which SQL workload files have been recorded. For details about how to record SQL workload files, see Enabling SQL Audit.

      Workload Type

      Only Audit log is supported.

      Time Range

      Select the time range for audit logs.

    • Source database information when Download from Huawei Cloud OBS is selected for Workload File Source
      Figure 7 Source database information

      Table 6 Source database settings

      Parameter

      Description

      Workload File Source

      Specifies where the workload file in the source database is from.

      Access Key ID (AK)

      Access key ID, which is a unique identifier used in conjunction with a secret access key to sign requests cryptographically.

      Secret Access Key (SK)

      Used together with the access key ID to sign requests cryptographically. It identifies a request sender and prevents the request from being modified.

      • Based on the principle of least permission, the AK/SK permissions must be minimized. If you can use both temporary and permanent AKs/SKs, you are advised to use a temporary AK/SK. Permanent AKs/SKs are used only in scenarios where temporary AKs/SKs cannot meet requirements. For example, if a large number of logs need to be downloaded for a long time, temporary AKs/SKs may become invalid due to timeout.
      • AK/SK information of the user is encrypted and temporarily stored in the system until the task is deleted.

      Security Token

      When a temporary AK/SK is used, Security Token must be used, and the recommended validity period is 24 hours. Otherwise, OBS bucket information may fail to be obtained during workload replay.

      Bucket Name

      Name of the OBS bucket for storing workload files.

      Endpoint

      OBS provides an endpoint for each region. An endpoint can be considered as the domain name of OBS in a region, and is used to process access requests from the region.

      Workload File Prefix

      Prefix of a file name in the OBS bucket. Only files whose names start with this prefix will be displayed.

      Workload Type

      Only Audit log is supported.

      Workload File

      Select the required workload file.

    • Destination database information
      Figure 8 Destination database information
      Table 7 Destination database settings

      Parameter

      Description

      DB Instance Name

      The RDS DB instance you selected when creating the task. This parameter cannot be changed.

      Database Username

      The username for accessing the destination database.

      Database Password

      The password for the database username.

      SSL Connection

      If SSL connection is required, enable SSL on the destination database, ensure that related parameters have been correctly configured, and upload an SSL certificate.

      NOTE:
      • The maximum size of a single certificate file that can be uploaded is 500 KB.
      • If SSL is disabled, your data may be at risk.

      The username and password of the destination database are encrypted and temporarily stored on the DRS instance host during the workload replay. After the task is deleted, the username and password are permanently deleted.

    • Task Settings
      Figure 9 Task settings
      Table 8 Task settings

      Parameter

      Description

      SQL Type

      Select the SQL type to be replayed to the destination database. The default value is SELECT. The available options are SELECT, INSERT, UPDATE, DELETE, and DDL.

      Replay Mode

      You can select Performance or Transaction.

      • In performance mode, you can set how many concurrent connections are allowed. SQL statements are replayed to the destination database based on a set number of connections. The SQL execution sequence in the source database may be different from that in the destination database. The replay performance is better.
      • In transaction mode, you cannot set how many concurrent connections are allowed. The number of connections is dynamically adjusted based on the connections in the source database logs to ensure that transaction SQL statements in the same connection of the source database are executed in sequence.

      Filter out SQLs

      The system fuzzily matches SQL statements based on the entered conditions, ignores case sensitivity, and filters SQL logs to be replayed to the destination database. The SQL logs that meet the conditions will be filtered out. You can configure up to 10 filtering rules.

      Filter out SQLs Without Conditions

      This option is used to filter out SQL statements of the SELECT, UPDATE, and DELETE types that do not contain conditions (that is, filter out SQL statements without a where condition).

      Maximum Concurrent Connections

      The number of replay threads configured for a workload replay task. The default value is 8. The value ranges from 1 to 100.

      Acceleration Configuration

      The percentage of the replayed SQLs to the SQLs executed on the source database within the same period. The percentage cannot exceed the maximum performance of the workload replay task. The value can be Unlimited, 100%, or 200%.

  4. On the Check Task page, check the replay task.

    • If any check fails, review the cause and rectify the fault. After the fault is rectified, click Check Again.
    • If all check items are successful, click Next.

  5. On the displayed page, specify Start Time, Send Notification, SMN Topic, and Stop Abnormal Tasks After and confirm that the configured information is correct and click Submit to submit the task.

    Figure 10 Task startup settings
    Table 9 Task startup settings

    Parameter

    Description

    Start Time

    Set Start Time to Start upon task creation or Start at a specified time based on site requirements.

    NOTE:

    After a replay task is started, the performance of the source and destination databases may be affected. You are advised to start a replay task during off-peak hours.

    Send Notifications

    SMN topic. This parameter is optional. If an exception occurs during workload replay, the system will send a notification to the specified recipients.

    SMN Topic

    This parameter is available only after you enable Send Notifications and create a topic on the SMN console and add a subscriber.

    For details, see Simple Message Notification User Guide.

    Stop Abnormal Tasks After

    Number of days after which an abnormal task automatically stops. The value must range from 14 to 100. The default value is 14.

    NOTE:

    Tasks in the abnormal state are still charged. If tasks remain in the abnormal state for a long time, they cannot be resumed. Abnormal tasks running longer than the period you set (unit: day) will automatically stop to avoid unnecessary fees.

  6. After the task is submitted, view and manage it on the Workload Replay Management page.

    • You can view the task status. For more information about task status, see Task Statuses.
    • You can click in the upper right corner to view the latest task status.
    • By default, DRS retains a task in the Configuration state for three days. After three days, DRS automatically deletes background resources, but the task status remains unchanged. When you reconfigure the task, DRS applies for resources for the task again.
    • For a public network task, DRS needs to delete background resources after you stop the task. The EIP bound to the task cannot be restored to the Unbound state until background resources are deleted.