Advanced Settings

更新时间:
复制 MD 格式

When running a stress test with Performance Testing Service (PTS), you can use the advanced settings to set a request connection timeout, add success status codes, or bind a domain name to a specific IP address.

General Settings

The settings in the General Settings section apply to all APIs in the scenario.

Parameter Description
Sample log rate Customize the sample rate for sample logs. The default rate is 1%. To decrease the rate, enter a value in the range (0, 1]. To increase the rate, enter a multiple of 10 in the range (1, 50], such as 20.
Important If you increase the sample rate, an additional fee of rate% is charged. For example, a sample rate of 20% incurs an additional fee of 20% × VUM.
Connection timeout The timeout period for a stress test request to access the API. Enter a multiple of 500 ms in the range (1, 120]. For example, for a timeout of 5000 ms, enter 10.
Request timeout The maximum time a virtual user waits for an acknowledgement after sending a request. Enter a multiple of 500 ms in the range (1, 120]. For example, for a timeout of 5000 ms, enter 10.
Note The request timeout in Advanced Settings applies to all APIs in the scenario. It has a lower priority than the timeout set in the basic request information for an API.
Add Success Status Code Customize the status codes that indicate a successful request. The added status codes and 2xx codes are all considered successful. For example, if a 302 response is considered normal but you cannot use 302 redirects, use this feature to add it as a success status code. This ensures the accuracy of your stress test results.
URL Encode Selected by default. All requests are first decoded and then encoded before being sent.

HTTPS Settings

Reset SSL state in each loop

For HTTPS stress tests, you must choose whether to reset the SSL connection state for each loop. If you reset the state, the SSL state is reinitialized at the start of each loop. This more accurately simulates a stress testing scenario where each loop represents a different user. However, this adds performance overhead to the stress testing machines.

Scenarios

  • Scenario 1: An HTTPS stress test that simulates 100 users logging in and then repeatedly accessing the system.

    In this case, each loop execution simulates the behavior of the same virtual user.

    Set this switch to No and the concurrency to 100.

  • Scenario 2: An HTTPS stress test that simulates 100 different users accessing the system at any moment within a 5-minute period.

    In this case, each loop execution simulates the behavior of a different virtual user.

    To ensure the simulation is realistic, set this switch to Yes and the concurrency to 100. Because this setting adds performance overhead, increase the number of IP addresses for the stress testing machines.

SSL protocol

In an HTTPS stress test, the SSL handshake begins when the client (the stress testing machine) informs the server-side of the highest SSL protocol version it supports. The server-side then selects the highest version that both parties support to establish the connection. The SSL protocol version that you configure here is the highest version that the client supports. The default is TLSv1.3.

The following table lists the SSL versions supported by common browsers:

Browser Browser version that supports TLSv1.3 Browser version that supports TLSv1.2
Chrome 70 and later 29 or higher
Safari 14 and later 7 and later
Edge 79 and later 12 and later
Firefox 63 and later At least 27
IE Not supported 11

As shown, major browsers began supporting TLSv1.3 between 2018 and 2020. Therefore, if your stress testing scenario simulates newer clients, select TLSv1.3 as the SSL version. If your scenario needs to simulate older browser clients, select TLSv1.2.

Domain name binding

Domain name binding associates a domain name with a specific IP address. During a stress test, traffic is sent directly to the bound IP address to test the target infrastructure. You may need to use the domain name binding feature in the following situations:

  • Stress testing in a public staging environment

    When stress test requests must be sent over the public network, you can bind the public domain name to the IP address of your staging environment. This isolates stress test traffic from production traffic.

  • Stress testing in PTS Alibaba Cloud VPC private network mode

    When you run a stress test in private network mode for Alibaba Cloud Virtual Private Cloud (VPC), the test traffic is sent over a VPC private network. To avoid changing the API's domain name, you can bind any domain name in the scenario to a VPC private network IP address. This lets you run the stress test within the Alibaba Cloud private network. For more information, see Alibaba Cloud VPC private network stress testing.

After you complete the Scenario Configuration, the system automatically detects all domain names from the configuration. You can then configure the domain name information on the Advanced Configuration tab in the Domain Name Binding section:

  1. For the target domain name, select Enable and enter the corresponding IP addresses in the IP List field. Separate multiple IP addresses with commas (,).

  2. Click Save Configuration in the upper-right corner to complete the domain name binding.

    After you save the binding, the stress test sends traffic directly to the IP addresses you configured.

Monitoring export

Enable the Prometheus Switch to export PTS stress test metrics to Prometheus. For more information about the configuration, see Export PTS stress test metrics to Prometheus.