This topic describes how to initiate performance testing on an Alibaba Cloud virtual private cloud (VPC). Compared with performance testing on the Internet, performance testing on a VPC is more secure and flexible. This is because performance testing on a VPC is entirely performed in your VPC environment and services are not exposed to the Internet.
Limits
Performance testing in an Alibaba Cloud VPC is subject to the following limits:
Resource limits: In an Alibaba Cloud VPC, the performance testing capabilities vary from 20,000 to 100,000 transactions per second (TPS) based on the region.
IP limits:
All API calls performed during the performance testing must use the VPC internal addresses or the domain names that are mapped to the VPC internal addresses. For more information about how to bind a domain name and an IP address, see Domain name-IP address binding.
A scenario supports up to one region. All testing APIs must use internal network services within the same region.
Others:
Internal network access can only be granted manually. Before you conduct the performance testing, familiarize yourself with the operations related to ECS security groups and Server Load Balancer (SLB) instances.
Prerequisites
The Alibaba Cloud VPC service is activated, and a VPC, vSwitch, and security group are created. For more information, see Create a VPC with an IPv4 CIDR block and Create a VPC with an IPv6 CIDR block.
A server is started in the VPC and security group rules are configured to ensure that the server can be accessed in the VPC. For more information, see Configure security groups in different scenarios.
Performance Testing (PTS) is activated. For more information, see Activate PTS.
Scenarios
Performance testing on a VPC is suitable for the following scenarios:
Your business requires high security, and the business data cannot be exposed to the Internet. For example, you can perform the testing in finance or insurance business scenarios.
During performance testing, you can add the IP address of the load generator to a whitelist to prevent access from the Internet. However, performance testing on a VPC is more secure because your business is completely isolated from the Internet.
Performance testing is required for services that are in the development phase. In this scenario, you need to detect the impact of the network environment on the performance testing results and separately evaluate the performance of the services.
Performance testing on a VPC allows you to quickly initiate performance testing on microservices in the development phase. If your service uses a microservice model, you can initiate performance testing on a VPC to evaluate the load of each service during the development phase. Traditional performance testing on the Internet requires you to expose the service to be tested on the Internet. This may pose high security risks and increase performance testing costs.
The performance of basic services, such as ApsaraMQ for MQTT and ApsaraDB for Redis, in an Alibaba Cloud VPC needs to be evaluated.
In most cases, basic Alibaba Cloud services such as ApsaraMQ for MQTT and ApsaraDB for Redis cannot be accessed over the Internet. Therefore, performance testing on such services must be performed within a VPC.
You want to reduce costs for performance testing.
Performance testing on the Internet generates a large amount of bandwidth traffic from the Internet, which incurs Internet bandwidth fees. Performance testing on a VPC is entirely performed in your VPC, and no additional network bandwidth fees are generated. This greatly reduces your performance testing costs.
Procedure
Log on to the PTS console, choose , and then click PTS.
On the Scenario Settings tab of the PTS Scenario page, configure the parameters. You can enter either a domain name or an internal IP address in the Test URL field. To use a vSwitch to access services in the VPC, the IP address must be within the CIDR block of the vSwitch.
In the Stress Mode Configuration section, set the Source of Stress parameter to Alibaba Cloud VPC. You can configure the stress testing parameters based on your business requirements. For more information, see Configure the stress testing mode and level.
ImportantThe region, VPC, security group, and vSwitch information that you enter in the Stress Mode Configuration section must be consistent with those of the service on which performance testing is performed.
To debug a stress testing scenario, click Debug in the lower part of the PTS Scenario page. For more information, see Debug a stress testing scenario.
In the lower part of the PTS Scenario page, click Save and Start. In the Note dialog box, set the Execution Cycle parameter to Execute Now, select the check box for The test is permitted and complies with the applicable laws and regulations, and then click Start Test.
Suggestions
Performance testing can be divided into single-link performance testing and full-link performance testing based on the scope of links to be tested.
Single-link performance testing
Single-link performance testing is used to test the performance of a specific link of a service and verify the stability of a single link. During single-link performance testing, only a small number of participants are involved, and the performance testing costs are low. Therefore, performance testing can be performed multiple times to verify the result.
Full-link performance testing
Full-link performance testing is used to test the performance of all links of a service and verify the global stability of the service. Full-link performance testing involves all upstream and downstream links. This helps identify performance bottlenecks of the service from an overall perspective. Full-link performance testing is a complex process. During the testing, a large number of participants are involved, and the performance testing costs are high. Therefore, the number of full-link performance tests must be strictly limited.
In most cases, you must perform single-link performance testing on a service multiple times before you can perform full-link performance testing. This is because the costs of the full-link performance testing are high. We recommend that you use a VPC for single-link performance testing because the cost of performance testing on a VPC is low and single-link performance tests need to be performed at a high frequency. This helps reduce the performance testing costs. After the service passes all single-link performance tests, you can configure the service and enable access to the service over the Internet. Then, you need to perform full-link performance testing on the Internet to verify the performance of all links of the service.