tencent cloud

Feedback

Implementing CRS Connection Count Increase with Custom Actions

Last updated: 2024-09-26 15:49:18

    Background

    CFG allows users to customize fault actions for chaos engineering experiments. In fault scenarios where stress test is executed on MySQL or CRS, a CVM instance within the same VPC as MySQL or CRS can be used to execute stress test scripts.

    Practical Examples

    The following demonstrates how to use custom actions to implement CRS connection count increase.

    Step 1: Experiment preparation

    A CVM instance used for fault injection with a Redis client installed, used to connect to the CRS instance (Ensure the CVM can be connected to the CRS instance.)
    A CRS instance that is in the same VPC with the CVM
    Fault action script file

    Step 2: Create custom actions

    1. Log in to Tencent Smart Advisor > Chaotic Fault Generator, enter the Action Library Management page, and select Create Custom Action.
    2. Configure the custom actions. Configure command content and command parameters. Click Save after you complete the configuration.
    The example command content includes parameters such as request_num, host, port, password, and client_count, which can be passed during execution.
    redis-benchmark -q -n {{request_num}} -h {{host}} -p {{port}} -a '{{password}}' -c {{client_count}}

    Step 3: Experiment orchestration

    1. Enter the Experiment Management page, click Create a New Experiment, fill in the experiment details, and select the objective CVM instance for the experiment.
    2. Click Add Experiment Action in the lower-left corner, select Shell Script, select the custom action you created, and click Next.
    3. Modify the default parameters of the action according to the stress test requirements.
    4. After configuring action parameters, click Next. After filling in the experiment global configuration, click Submit.

    Step 4: Execute the experiment

    1. Execute the experiment and observe the execution results.
    2. During execution, you can monitor data on the CRS console.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support