当前位置:网站首页>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
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/
边栏推荐
- 2022PMP考试基本情况详情了解
- Firebird experience summary
- S2b2b solution for lighting industry: efficiently enable the industrial supply chain and improve the economic benefits of enterprises
- 从数数开始
- Cypher task design and task locking mechanism of isomorphic and heterogeneous graphs
- 科普达人丨一文看懂阿里云的秘密武器“神龙架构”
- 安信证券排名 网上开户安全吗
- [acwing] 58 weeks 4490 dyeing
- 基于wifi控制的51单片机温度报警器
- Rebalance operation in spark and its difference from repartition operation
猜你喜欢
Can you really use MySQL explain?
Go micro tutorial - Chapter 2 go micro V3 using gin and etcd
Overflow: the combination of auto and Felx
S2b2b solution for lighting industry: efficiently enable the industrial supply chain and improve the economic benefits of enterprises
太方便了,钉钉上就可完成代码发布审批啦!
MVC模式和三层架构
"Cannot initialize Photoshop because the temporary storage disk is full" graphic solution
Blood spitting finishing nanny level series tutorial - play Fiddler bag grabbing tutorial (2) - first meet fiddler, let you have a rational understanding
How can programmers improve the speed of code writing?
新的职业已经出现,怎么能够停滞不前 ,人社部公布建筑新职业
随机推荐
基于check-point机制的任务状态回滚和数据分块任务
Redis 的内存淘汰策略和过期删除策略的区别
中位数与次序统计量
Task state rollback and data blocking tasks based on check point mechanism
DC-2靶场搭建及渗透实战详细过程(DC靶场系列)
Firebird experience summary
APOC自定义函数和过程
Li Kou today's question -1200 Minimum absolute difference
Research Report on market supply and demand and strategy of China's plastics and polymer industry
. Net applications consider x64 generation
安信证券排名 网上开户安全吗
[acwing] 58 weeks 4490 dyeing
安信证券网上开户安全吗 开户收费吗
[Acwing] 58周赛 4490. 染色
detectron2安装方法
表单传递时,如何隐式将值传过去
[Chongqing Guangdong education] National Open University spring 2019 1248 public sector human resource management reference questions
嵌入式软件架构设计-函数调用
Position encoding practice in transformer
Object. Usage of keys()