当前位置:网站首页>Load test practice of pingcode performance test
Load test practice of pingcode performance test
2022-07-04 17:13: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

bintemplatesjmeter.properties
templates.xml

Project preparation and configuration file modification
pc-perfcd 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.xmlJMeter 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.valueloginResponse_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/
边栏推荐
- Oracle监听器Server端与Client端配置实例
- "Cannot initialize Photoshop because the temporary storage disk is full" graphic solution
- Spark 中的 Rebalance 操作以及与Repartition操作的区别
- PyTorch深度学习快速入门教程
- Research Report on market supply and demand and strategy of China's plastics and polymer industry
- 时序图数据建模与产业链分析
- 2022年国内云管平台厂商哪家好?为什么?
- Cypher task design and task locking mechanism of isomorphic and heterogeneous graphs
- Linear time sequencing
- [Acwing] 58周赛 4489. 最长子序列
猜你喜欢

《吐血整理》保姆级系列教程-玩转Fiddler抓包教程(2)-初识Fiddler让你理性认识一下

PingCode 性能测试之负载测试实践

Detailed process of DC-2 range construction and penetration practice (DC range Series)

L1-072 scratch lottery

建筑建材行业经销商协同系统解决方案:赋能企业构建核心竞争力

从数数开始

Go micro tutorial - Chapter 2 go micro V3 using gin and etcd
Why do you say that the maximum single table of MySQL database is 20million? Based on what?

S2b2b solution for lighting industry: efficiently enable the industrial supply chain and improve the economic benefits of enterprises

Congratulations to Mr. Zhang Pengfei, chief data scientist of artefact, for winning the campaign Asia tech MVP 2022
随机推荐
Learn more about the basic situation of 2022pmp examination
高度剩余法
一加10 Pro和iPhone 13怎么选?
Is it safe for CITIC Securities to open an account online? Is the account opening fee charged
【模板】【luogu P4630】Duathlon 铁人两项(圆方树)
Chow Tai Fook fulfills the "centenary commitment" and sincerely serves to promote green environmental protection
TP configuring multiple databases
C # realizes FFT forward and inverse transformation and frequency domain filtering
Go language loop statement (under Lesson 10)
Li Kou today's question -1200 Minimum absolute difference
Two methods of MD5 encryption
Research Report on market supply and demand and strategy of China's Sodium Tetraphenylborate (cas+143-66-8) industry
Height residual method
矿产行业商业供应链协同系统解决方案:构建数智化供应链平台,保障矿产资源安全供应
World Environment Day | Chow Tai Fook serves wholeheartedly to promote carbon reduction and environmental protection
Research Report on plastic recycling machine industry - market status analysis and development prospect forecast
FIREBIRD使用经验总结
Position encoding practice in transformer
China's plastic processing machinery market trend report, technological innovation and market forecast
建筑建材行业经销商协同系统解决方案:赋能企业构建核心竞争力