Updated on 2024-04-08 GMT+08:00

Pressure Configuration

Procedure

  1. Log in to the CodeArts PerfTest console and choose PerfTest Projects in the left navigation pane.
  2. Click the name of the desired PerfTest project to go to the details page.
  3. On the Cases tab, select the desired test case in the case list on the left.
  4. Click Pressure Configuration and set phase parameters by referring to Table 1.

    • A maximum of 1000 phases can be added to a case.
    Table 1 Adding a phase

    Parameter

    Description

    Phase Name

    Phases names are used to distinguish different phases. For example, you can set the name to Home page test.

    Pressure Mode

    The following modes are supported:

    • Concurrency Mode: The performance test is performed based on the number of concurrent users. The number of concurrent users can be a fixed number or can be set to ramp up throughout the phase.
    • TPS Mode: The performance test is performed based on the number of transactions per second (TPS). In TPS mode, each execution of a test case by a virtual user is considered a transaction. The actual TPS may not reach your specified value because it will be affected by the specified maximum number of concurrent users and the average transaction latency.
    • Peakload Mode: The pressure test is performed based on the number of concurrent users who stays at the peak after increasing from the minimum concurrency to the maximum concurrency at a specified ramp-up time.
    • Surge Mode: The pressure test is performed based on the number of concurrent users who changes periodically. In each period, the minimum concurrency is tested first, then the maximum concurrency. The duration is based on the maximum concurrency and can be customized. The number of periods is the specified surge counts.
    • Oscillation Mode: The pressure test is performed based on the number of concurrent users who fluctuates periodically. The number of users in each period fluctuates between the minimum concurrency and the maximum concurrency. The number of periods is the specified oscillation counts.
    • Intelligent Peakload: The pressure test is performed based on the number of concurrent users who stays at the peak after increasing from the minimum concurrency to the maximum concurrency by a specified single-step execution duration.
      NOTE:

      The executor performs a pressure test by gradually increasing the number of concurrent users based on the specified gradient. During the pressure test, the background generates a phase data for each gradient. When the data in a phase has an obvious performance inflection point compared with that in the previous phase, the system determines that the peak performance is reached. The performance inflection point is defined in the following scenarios: The success rate is lower than the threshold (100% by default), the RPS curve decreases, and the rt/tp90/tp99 curve changes greatly in skew rate.

    Execution Policy

    The value can be Duration or Count.

    • Duration: Tests will be performed based on the specified duration. The number of tests is not limited.
    • Count: Tests will be performed based on the total number of tests.
    NOTE:

    This parameter is involved only in the concurrency mode and TPS mode.

    Load Adjustment

    Auto and manual load adjustments are supported.

    • Auto: The maximum number of concurrent users of all stages is used as the maximum concurrency.
    • Manual: The maximum number of concurrent users during a test is used as the maximum concurrency. After manual load adjustments, the original multi-stage pressure configuration becomes invalid.
    NOTE:

    This parameter is involved only in the concurrency mode and TPS mode, and Execution Policy is set to Duration.

    When Pressure Mode is set to Concurrency Mode, Execution Policy is set to Duration, and Load Adjustment is set to Auto, set the following parameters.

    Concurrent Users

    Concurrency refers to the number of users performing operations on a system at the same time.

    In CodeArts PerfTest, it is the number of virtual users you define when you configure a test phase.

    Start Concurrency

    Starting number of virtual users for a test case.

    Ramp Up(s)

    Time required for increasing the start concurrency to the maximum concurrency.

    Duration (min)

    Duration that the phase will last.

    When Pressure Mode is set to Concurrency Mode, Execution Policy is set to Duration, and Load Adjustment is set to Manual, set the following parameters.

    Maximum Concurrency

    Maximum number of virtual users for a test case.

    Start Concurrency

    Starting number of virtual users for a test case.

    Duration (min)

    Duration that the phase will last.

    When Pressure Mode is set to Concurrency Mode and Execution Policy is set to Count, set the following parameters:

    NOTE:

    Only a single phase can be added.

    Concurrent Users

    The number of concurrent users refers to the number of users performing operations on the system at the same time.

    In CodeArts PerfTest, it is the number of virtual users you define when you configure a test phase.

    Total Sending Times

    When the task is running, the performance test in this phase will be executed repeatedly until the number of execution times reaches the specified value.

    NOTE:

    The total sending times must be greater than or equal to the number of concurrent users.

    When Pressure Mode is set to TPS Mode, Execution Policy is set to Duration, and Load Adjustment is set to Auto, set the following parameters.

    Maximum Concurrency

    Maximum number of virtual users for a test case.

    TPS Value

    Number of transactions executed per second.

    Duration (min)

    Duration that the phase will last.

    When Pressure Mode is set to TPS Mode, Execution Policy is set to Duration, and Load Adjustment is set to Manual, set the following parameters.

    Maximum Concurrency

    Maximum number of virtual users for a test case.

    Start Concurrency

    Starting number of virtual users for a test case.

    TPS Value

    Number of transactions executed per second.

    Duration (min)

    Duration that the phase will last.

    When Pressure Mode is set to TPS Mode and Execution Policy is set to Count, set the following parameters:

    NOTE:

    Only a single phase can be added.

    Maximum Concurrency

    Maximum number of virtual users for a test case.

    TPS Value

    Number of transactions executed per second.

    Total Sending Times

    When the task is running, the performance test in this phase will be executed repeatedly until the number of execution times reaches the specified value.

    NOTE:

    The total sending times must be greater than or equal to the number of concurrent users.

    When Pressure Mode is set to Peakload Mode, set the following parameters.

    Start Concurrency

    Starting number of virtual users for a test case.

    Maximum Concurrency

    Maximum number of virtual users for a test case.

    Ramp Up(s)

    Duration for which the number of virtual users increases from the start concurrency to the maximum concurrency.

    NOTE:

    The recommended ramp-up time is shorter than the duration. If the ramp-up time is the same as the duration and the concurrency is large, the sampled maximum concurrency may be slightly less than the configured maximum concurrency.

    Duration (min)

    Duration that the phase will last.

    Expected KPI

    • Maximum response time: 60,000 ms
    • Minimum success rate: 0

    In peakload mode, the expected request response time of the tested system is less than or equal to the input value, and the request success rate is greater than or equal to the input value. If an indicator is unacceptable for six consecutive seconds for the first time (for example, the response time is greater than the expected value for six consecutive seconds), use the data in the first second as the analysis result.

    NOTE:

    When the execution of a test case reaches the expected level, the task continues.

    When Pressure Mode is set to Surge Mode, set the following parameters.

    Duration (min)

    Duration that the phase will last.

    Maximum Concurrency

    Maximum number of virtual users for executing a test case, which is also the peak value during the changing number of virtual users.

    Minimum Concurrency

    Minimum number of virtual users for executing a test case, which is also the minimum value during the fluctuation of the number of virtual users.

    Surge Count

    Number of periods in which the number of virtual users fluctuates within the duration.

    Peak Duration(s)

    Duration of a stage based on the maximum number of concurrent virtual users in a period.

    When Pressure Mode is set to Oscillation Mode, set the following parameters.

    Duration (min)

    Duration that the phase will last.

    Maximum Concurrency

    Maximum number of virtual users for executing a test case, which is also the peak value during the fluctuation of the number of virtual users.

    Minimum Concurrency

    Minimum number of virtual users for executing a test case, which is also the trough value during the fluctuation of the number of virtual users.

    Oscillation Count

    Number of periods in which the number of virtual users fluctuates within the duration.

    When Pressure Mode is set to Intelligent Peakload, set the following parameters.

    Start Concurrency

    Starting number of virtual users for a test case.

    Increase Concurrency

    Number of virtual users increased by step.

    NOTE:
    • Increase Concurrency increases exponentially.

    Single-step Execution Duration(s)

    Duration of each incremental concurrency. You are advised to set this parameter to at least 20 seconds.

    Duration (min)

    Duration that the phase will last. You are advised to set this parameter to less than 30 minutes.

    NOTE:
    • When the success rate is lower than the threshold (100% by default), the RPS curve decreases, or the rt/tp90/tp99 curve changes greatly in skew rate, the pressure test stops.

  5. When the configuration is complete, click Save.