The Alibaba Cloud 2021 Double 11 Cloud Services Sale is live now! For a limited time only you can turbocharge your cloud journey with core Alibaba Cloud products available from just $1, while you can win up to $1,111 in cash plus $1,111 in Alibaba Cloud credits in the Number Guessing Contest.
This is the latest article of the Best Practices of Spring Cloud Applications in Kubernetes blog series. This article will introduce how to ensure high business availability from another perspective, that is, to locate bottlenecks and assess the capacity online and in advance in the business preparation stage. By doing so, users can reduce costs, and discover system bottlenecks more efficiently and precisely, as well as achieving the most accurate capacity assessment.
First, let's take a look at the highly-available system. What are the high-availability policies during the application lifecycle and what capabilities do they have?
As shown above, responsive high availability policies are configured throughout the application lifecycle. For example, as introduced in previous articles, the traffic protection is the online management policy during online operation. The chaos engineering is the policy for system drills. Moreover, the full-procedure stress testing is an important policy in the planning stage, including online stress testing (environment selection), capacity planning (stress testing implementation), and elastic scaling (intra-ecosystem collaboration).
Following sections focus on the importance of capacity assessment and its implementation through stress testing.
The importance and necessity of the capacity assessment is an echoing issue. Today, I would like to summarize its importance and necessity from perspectives of technology and business strategy.
The purpose of capacity assessment is to solve capacity problems, like preparations for new business launch and large marketing activities. System performance uncertainty caused by peak traffic in large activities is the typical scenario that needs the capacity assessment the most. The cycle of an ideal marketing activity should have a closed-loop process as followings:
Performance testing is the core means of capacity assessment. After performance testing, a series of monitoring and analysis are performed on the client, application system, and basic load. Finally, bottlenecks can be located and corresponding optimizations can be determined. As shown in the above figure, performance testing assesses capacity, and locates and solves bottlenecks through precise and efficient stress testing, ensuring the stable performance of activities.
It has been seven years since the launch of Alibaba Cloud's full-procedure stress testing in 2013. During these seven years, Alibaba Cloud has continuously accumulated and summarized experience, and made optimizations and progresses. Effective process and labor division managements are indispensable for such a large-scale project. The preliminary preparation for the full link stress testing will not be described again here. If you are interested, see the article How Does Alibaba Cloud Implement Full-procedure Stress Testing?. The following parts will focus on operations of the stress testing in the execution stage.
Before full-procedure stress testing, a single application performs internal stress testing to improve the efficiency of full-procedure stress testing. That is to say, the linkage problem is solved after internal problems. So, following sections will describe how to implement the stress testing on Spring Cloud applications and the full-procedure stress testing.
Many developers choose open-source JMeter for single-application stress testing, and they even build platforms for high concurrency. However, both of the two methods are not recommended because of their obvious disadvantages. Alibaba Cloud Performance Testing Service (PTS), however, is an on-cloud stress testing service that is compatible with JMeter. Users only need to upload scripts to initiate stress testing.
At the same time, PTS supports direct stress testing for microservices. Users do not need to manually manage and upgrade plug-ins. Instead, they only need to directly select the corresponding information in PTS to initiate stress testing quickly.
The full-procedure stress testing involves many preliminary steps, such as environment selection and transformation, data preparation, and security policies, just like performance stress testing introduced before. So, preliminary steps will not be described here. This section mainly introduces the implementation of the full-procedure stress testing. In other words, by configuring the same business scenario as the online business model, the full-procedure stress testing assesses capacity and locates bottlenecks through multi-dimensional and multi-scenario stress testing with real traffic from the public network.
Generally, multiple stress testing policies are implemented in formal testing, according to the stress testing plan. For example, stress testing for Taobao's Double 11 generally includes following steps:
• Peak pulse simulation
Peak pulse simulation simulates the exact target peak traffic at 00:00 of the promotion day. Though the simulation, Taobao can conduct a promotion-state stress testing and observe the system performance.
• System limit testing
System limit testing disables traffic limiting and degradation protection and raise the current stress testing value to observe the system limit. Note that the limit testing can be carried out only after the target stress testing value has been reached. Increased-value stress testing can be implemented for several times until the system encounters an exception.
• Traffic limiting and degradation verification
Traffic limiting and degradation verification is used to verify whether the traffic limiting and degradation protection is normal. The product Application High Availability Service (AHAS) provides comprehensive traffic limiting and degradation capabilities for full-procedure degradation protection.
• Destructive testing
Destructive testing is designed to verify the effectiveness of the plan. It is similar to the plan implementation in the disaster recovery exercise. In this test, the promotion-state stress testing is kept going to verify the effectiveness of the plan and observe the impact on the system after implementation.
Above-mentioned stress testing steps can all be implemented in PTS. In addition, PTS allows the configuration of data at different testing levels for multiple stress testing and system performance observance. Stress testing should be repeatedly implemented and verified. The following section takes peak pulse simulation as an example to introduce steps of stress testing in PTS.
The first step is the scenario construction. PTS provides various methods for scenario construction, including JSON, JMX, and YAML scripts importing, zero-code interactive UI creating, and result importing from cloud recorder. Besides, PTS is fully compatible with JMeter scripts. The following diagram shows the scenario construction.
Take PTS exclusive native engine, also called interactive UI orchestration model as an example. After creating a business scenario, PTS provides stress source customization capability. With this capability, users can customize stress sources from multiple regions and operators, and simulate real traffic conditions in a more authentic manner.
In addition, "unmanned" stress testing can be implemented through SLA and scheduled task capability. Thus, performance limits testing of core business procedures can be implemented periodically.
After the stress testing is completed, PTS provides a downloadable stress testing report. The report contains detailed statistical data, trend chart data, sampling logs, and monitoring data. Users can quickly locate and analyze problems.
Alibaba Cloud Enterprise Distributed Application Service (EDAS) supports microservices governance and integrates the stress testing capabilities of PTS. On the service query page, users can click stress testing button to start performance testing in PTS, as shown in the following figure:
This article briefly introduces the relevant policies of the business highly-available system, the importance of capacity assessment, and implementation methods of performance testing. This article also introduces the quick application of stress testing in Spring Cloud. In addition, there are much more functions of PTS:
• Isolated transformation of full-procedure stress testing traffic
• Environment management and localized plug-ins of JMeter
• Architecture monitoring of cloud business during stress testing
• Advanced traffic customization of JMeter
Taking performance stress testing as the main line, Alibaba Cloud conducts system capacity assessment during the planning period. By taking stress testing results for reference, Alibaba Cloud carries out multi-dimensional system protection from Gateways to applications, through traffic protection of AHAS. By doing so, Alibaba Cloud achieves high availability after business system is launched. In the future, PTS and AHAS will provide more intelligent functions to better help online services achieve continuity in various extreme scenarios.
Alibaba Announced Ten Cutting-Edge Technologies for the Most Innovative Double 11 in History
2,599 posts | 764 followers
FollowAlibaba Developer - September 6, 2021
Alibaba Cloud Native Community - March 2, 2023
Alibaba Clouder - November 3, 2017
Alibaba Cloud Native Community - September 12, 2023
Alibaba Cloud Native Community - January 5, 2023
Alibaba Clouder - April 8, 2020
2,599 posts | 764 followers
FollowGet started on cloud with $1. Start your cloud innovation journey here and now.
Learn MoreMSE provides a fully managed registration and configuration center, and gateway and microservices governance capabilities.
Learn MoreA PaaS platform for a variety of application deployment options and microservices solutions to help you monitor, diagnose, operate and maintain your applications
Learn MoreMore Posts by Alibaba Clouder