当前位置:网站首页>Load test practice of pingcode performance test
Load test practice of pingcode performance test
2022-07-04 18:06:00 【InfoQ】
What is performance testing
The type of performance test
- The load test: Usually, the purpose of load testing is to understand the behavior of the system under a specific expected load . This load can be the expected number of concurrent users on the application , The application executes a specific number of transactions within a set duration . This test will give the response time of all important business critical transactions . The database will also be monitored during the test 、 Application server, etc , This will help identify bottlenecks in the application software and the hardware where the software is installed
- Pressure test: It is usually used to understand the capacity limit in the system . This test is conducted to determine the robustness of the system in terms of extreme loads , And help application administrators determine if the current load is much higher than the expected maximum , Whether the system can operate fully .
- Soak Test: Also known as durability test , It is usually used to determine whether the system can withstand the continuous expected load . During the soak test , Memory utilization is monitored to detect potential leaks . Equally important but often overlooked is performance degradation , That is to ensure that the throughput and response time after a long period of continuous activity are as good or better as at the beginning of the test . It essentially involves putting a lot of load on the system over a long period of time . The goal is to find out how the system behaves under continuous use .
- Peak test: By suddenly increasing or decreasing the load generated by a large number of users , And observe the behavior of the system to complete . The goal is to determine whether performance will be affected , The system will fail , Still able to deal with drastic changes in load .
- Breakpoint test: Breakpoint testing is similar to stress testing . Apply incremental loads over time , At the same time, the predetermined fault conditions of the monitoring system . Breakpoint testing is sometimes called capacity testing , Because it can be said that it determines the maximum capacity that the system will perform according to its required specifications or service level agreements . The breakpoint analysis results applied to the fixed environment can be used to determine the best expansion strategy according to the required hardware or the conditions that should trigger the horizontal expansion event in the cloud environment .
- Configuration testing: Instead of testing performance from a load perspective , Instead, create tests to determine the impact of configuration changes to system components on system performance and behavior . A common example is trying different load balancing methods .
- Isolation test: Isolation testing is not unique to performance testing , It involves repeating tests that cause system problems . Such a test can usually isolate and confirm the fault domain .
Basic process of performance test
- Determining the test environment : By identifying available hardware 、 Software 、 Network configuration and tools , The test team can design tests and identify performance test challenges as early as possible . Performance test environment options include :
- Determine performance indicators : In addition to determining the response time 、 Throughput, constraints and other indicators , Also determine the success criteria for performance testing , According to the regulations of the team in the project .
- Plan and design performance tests : Considering the variability of users 、 Performance test scenarios for testing data and target metrics , You can create one or two models .
- Configure test environment : Prepare the test environment machines and tools needed to monitor resources .
- Develop test scripts
- Execute test plan : Running performance tests , Monitor and capture the generated data .
- analysis 、 The report 、 To test : Analyze the data and share the performance conclusions . Run the performance test again with the same parameters and different parameters .
Performance testing tools
- JMeter: It's a Apache Performance testing tools , It can be done to Web Load test with application services . JMeter Plug ins provide flexibility in load testing , And covers graphics 、 Thread group 、 timer 、 Functions and logic controllers . JMeter Support integrated development environment (IDE), For browser or Web Test the application , And for load testing based on Java Command line mode of the operating system .
- LoadRunner: from Micro Focus Development , Used to test and measure the performance of applications under load . LoadRunner It can simulate thousands of end users , And record and analyze the load test . As part of the simulation , The software generates messages between application components and end-user actions , Similar to key click or mouse movement . LoadRunner It also includes cloud oriented versions .
- NeoLoad: from Neotys Development , by Web And mobile applications to provide load and stress testing , Designed to test applications before release to achieve DevOps And continuous delivery IT The team can use this program to monitor Web、 Database and application server . NeoLoad It can simulate millions of users , And perform tests internally or through the cloud .
Performance test indicators
- throughput : How many information units does the system process in a specified time .
- response time : The amount of time elapsed between the request entered by the user and the system beginning to respond to the request .
- bandwidth : The amount of data that can be moved between workloads per second , Usually refers to through the network .
- Per second CPU Interruption times : The average value is taken . Refers to the number of hardware interrupts received and processed by the processor per second .
- Memory usage : The amount of physical memory available to processes on the computer .
- Disk usage : The amount of time the disk is busy executing read or write requests
A non systematic performance test practice
Test type
Test range
- Sub products involved : Project , Testhub , Wiki , Insight , Goals , Flow 6 Sub products .
- Basic services :Typhon service
Test purpose
- Ensure the reliability of the system in the case of multiple users : By implementing different performance test scenarios , Evaluate and verify the reliability of the core functions of the system under high load .
- Provide a round of system performance test , Provide baseline data for the next round of production environment performance testing .
- Evaluate the rationality of system deployment resources : Continuously collect and analyze performance test process data , Evaluate and make suggestions on the system resources required for the next system deployment .
- Optimize and solve system performance problems : During the test , Optimize the parameters of the system and solve the system performance problems found .
Test index standard
- According to the number of online users provided by operation and maintenance , To calculate the users of the production environment TPS, Pass the test of benchmark environment , To verify the real TPS Whether it meets the requirements of the production environment TPS demand , And whether our operation and maintenance structure and resource use are reasonable .
- Guaranteed at CPU The utilization rate is less than 80%, Memory less than 80%, And there is no mistake Http request .
Test practice
Testing tools
- use Jmeter + Grafana + Influxdb To complete the performance test .
- Jmeter GUI GUI tools : In order to facilitate development and debugging , Use the graphical interface to write the required test plan .
- Jmeter NO-GUI Pattern : Support large load test scenarios 、 Improve the efficiency of script execution and facilitate the subsequent configuration of scripts to Jenkins To achieve continuous integration on , Make automated testing .
Environment building
- install Java Of Jdk, Version follows Jmeter Version corresponding .
- install Jmeter Tools
Jmeter The value of the number of passes in the center line is based on
- First of all, understand the number of users 、 Number of threads 、TPS
- adopt TPS Calculate the number of threads of the press according to the benchmark
Jmeter Project directory structure
bin
templates
jmeter.properties
templates.xml
Project preparation and configuration file modification
pc-perf
cd jmeter/bin
git clone [git Project address ]
- common Folder : It is used to store the test plan template and template configuration file templates.xml.
- Sub application directory : And common The peer directory is the sub application directory , As the goal Goals、 project Project etc. . This directory is used to store the corresponding .jmx Test plan file .
template.files = /bin/pc-perf/common/templates/templates.xml
JMeter Template development
- Open browser developer tools
- obtain signin Information
fetch("http://at.pingcode.fun/**/signin",
{
"credentials":"include",
"headers":{
"accept":"application/json, text/plain, */*",
"accept-language":"zh-CN,zh;q=0.9",
"content-type":"application/json"
},
"referrer":"http://at.pingcode.fun/signin",
"referrerPolicy":"no-referrer-when-downgrade",
"body":"{\"signin_name\":\"**\",\"password\":\"**\",\"captcha_code\":\"\"}",
"method":"POST",
"mode":"cors"
});
- You can use the previous step in the developer tool of the browser Copy request headers Get the complete request header information
- It comes with components “ Add... From the clipboard ” function , One click configuration request header information
- Use Javascript Language to write scripts
- Extract users 、 The team 、token Information
// here loginResponse_1 It's from JSON The debugging results of the extractor can be obtained
var loginResponseString = vars.get("loginResponse_1")
var loginResponse = JSON.parse(loginResponseString)
log.info("loginResponseString:"+ loginResponseString)
// Set variables in this thread group
vars.put("user", JSON.stringify(loginResponse.user))
vars.put("team", JSON.stringify(loginResponse.team))
vars.put("access_token", loginResponse.access_token)
// Will the user 、 The team 、token Information is declared as global variables , Used for later thread groups
${__setProperty(user, ${user})}
${__setProperty(team, ${team})}
${__setProperty(access_token, ${access_token})}
data.value
loginResponse_1
- Modify user parameter processor
Local variable calling method :
Use... In components :${key}
Use in script :vars.get(key)
- modify BeanShell Preprocessor
How to call global variables :
Use in components :${__P(key)}
Use... In scripts :props.get(key)
name: Template name , Used to display in the template list
fileName: The path of the test plan to be configured as a template
description: Template description
parameters: Template parameters , You can use the template UI Page to page test plan .jmx File dynamic transfer parameters .
adopt [=key] Receive template parameters in the form of
Development sub application API test plan
adopt Non-GUI Way to execute all test plans
jmeter -n -t <testfile> -l <logfile>
Example :jmeter -n -t test.jmx -l test.jtl
Explain : Run on the command line test.jmx Script and generate test.jtl Log report .
-h Print usage information and exit
-n Not GUI Pattern -> In Africa GUI Run in mode JMeter
-t The test file < Parameters > -> To run jmeter test (.jmx) file .
-l Log files < Parameters > -> Generated log files
-H Set the... To use JMeter proxy server
-P Set the... To use JMeter Proxy port
Information
- wikipedia : https://en.wikipedia.org/wiki/Software_performance_testing
- Jmeter: https://jmeter.apache.org/
- LoadRunner: https://en.wikipedia.org/wiki/LoadRunner
- NeoLoad: https://www.tricentis.com/products/performance-testing-neoload/
边栏推荐
- Stars open stores, return, return, return
- Large scale service exception log retrieval
- regular expression
- 要上市的威马,依然给不了百度信心
- 【HCIA持续更新】WLAN工作流程概述
- With an estimated value of 90billion, the IPO of super chip is coming
- Face_ Attendance statistics of recognition face recognition
- 【Hot100】32. 最长有效括号
- 【华为HCIA持续更新】SDN与FVC
- Easy to use map visualization
猜你喜欢
简单易用的地图可视化
Vscode modification indentation failed, indent four spaces as soon as it is saved
上市公司改名,科学还是玄学?
[Huawei HCIA continuous update] SDN and FVC
Superscalar processor design yaoyongbin Chapter 7 register rename excerpt
就在今天丨汇丰4位专家齐聚,共讨银行核心系统改造、迁移、重构难题
ISO27001认证办理流程及2022年补贴政策汇总
With the stock price plummeting and the market value shrinking, Naixue launched a virtual stock, which was deeply in dispute
Ks007 realizes personal blog system based on JSP
创业两年,一家小VC的自我反思
随机推荐
What are cache penetration, cache breakdown, and cache avalanche
New technology releases a small program UNIPRO to meet customers' mobile office scenarios
Redis主从复制
【HCIA持续更新】WLAN工作流程概述
VSCode修改缩进不成功,一保存就缩进四个空格
Vscode modification indentation failed, indent four spaces as soon as it is saved
12 - explore the underlying principles of IOS | runtime [isa details, class structure, method cache | t]
mysql5.7安装教程图文详解
[HCIA continuous update] overview of WLAN workflow
国产数据库TiDB初体验:简单易用,快速上手
Internet addiction changes brain structure: language function is affected, making people unable to speak neatly
How to test MDM products
五千字讲清楚团队自组织建设 | Liga 妙谈
[proteus simulation] printf debugging output example based on VSM serial port
【HCIA持续更新】网络管理与运维
Hidden corners of coder Edition: five things that developers hate most
[daily question] 556 Next bigger element III
Dynamic programming stock problem comparison
Great Wall Securities security does not open a securities account
【Hot100】31. 下一个排列