Author:
introduction
"The stress test script runs well in my stress test environment. The success rate and RT are all normal. How can it behave differently when running locally?"
Have you encountered the above problems during the stress test?
In addition to the commonplace hardware configuration reasons, traffic distribution factors are often easily overlooked.
Why simulate real user traffic
Stress testing is to simulate a certain amount of real users to access the system. The actual number of users can be simulated by setting the number of concurrent threads (virtual users); the source distribution of users, specifically traffic distribution, is also an important simulation condition.
Assist global capacity planning
Applications with a large number of users generally adopt a remote deployment method. Due to cost considerations, the deployment specifications of each center may not be the same. The more local users, the higher the number of center instances and the higher the specifications. The big promotion pressure test is to simulate the traffic according to the distribution ratio of real users. Tested out which center capacity water level is too high, will cause local user response delay or even service collapse; which center capacity water level is too low, can be appropriately downgraded, the excess instance quota is reasonably allocated. Realize the capacity planning from the overall level, while supporting the large promotion traffic, but also reasonably controlling the cost.
Tested out the true mapping delay
The data shows that for the core interface of e-commerce business, for every 100ms increase in response time, the revenue will decrease by 1%. If the pressure machine and the server are in the same computer room, the test response time (RT) will be lower than the real situation, because the users are distributed across the country. A few tenths of a second lower than the misjudgment of the response delay may result in an erroneous expectation of the turnover of the big promotion.
The problem can be seen intuitively through the following figure:
How to simulate real traffic
Traditional solution
The users of most services are not evenly divided by region, on the contrary, they are often very uneven. To simulate the real flow distribution, the press needs to deploy , and support by region and by quantity, and support real-time unified scheduling during pressure testing. If the presses are distributed in a Region or even an availability zone, it is impossible to simulate requests from users around the world.
This requires the deployment of a large number of pressure machines at home and abroad. If the frequency of pressure testing is not very high, the idle cost of the machine can be imagined. The dispatch system that is distributed by region and by volume also requires a certain maintenance cost.
Alibaba Cloud PTS solution
When using the Alibaba Cloud Performance Testing Service (PTS) pressure test, you can enable the flow region customization function to specify the geographic distribution of the pressure machine. Currently, the regional customization of 22 regions around the world is supported. Alibaba Cloud's PTS, as a large-scale pressure measurement weapon, has undiminished "power" and is lighter when used.
See the table for supported regions:
No matter which scheme is selected, the geographical distribution of presses must be consistent with the distribution of users in the end.
Operation guide
1. Create a stress test scenario and refer to the PTS guidance document (for details, please refer to the relevant link at the end of the article);
2. In the pressure configuration, open the flow area configuration and allocate the flow ratio according to the business needs. You can see the pie chart of the flow distribution on the right:
3. Start the pressure test. On the pressure test overview page, you can view the geographical distribution of traffic:
Summarize
During pressure testing, the source of pressure flow is a factor that is easily overlooked. To ensure that the pressure test results are true and credible, it is necessary to prepare the presses according to the geographical distribution of real users. Cloud PTS provides the traffic region customization function, which can be used immediately. It supports 22 Regions around the world, and can be used in the trial version resource pack of 9.9 yen.
Related Links
1) Alibaba Cloud PTS:
https://pts.console.aliyun.com/#/overviewpage
2) Open the PTS experience version resource pack
https://common-buy.aliyun.com/?commodityCode=ptsbag#/buy
3) PTS guidance document https://help.aliyun.com/document_detail/90887.html
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。