当前位置:网站首页>JMeter single scenario usage example of performance test learning
JMeter single scenario usage example of performance test learning
2022-07-20 23:36:00 【cheryl88】
Preface
The performance test is mainly used to check whether the system performance meets the requirements
The above is the performance test process
- Demand analysis , Analyze the system performance index
- Prepare the environment 、 Tools and scenarios
- Preparation script , Complete test preparation based on different performance scenarios
- Execute the script , get data
- Determine whether the index meets the requirements
- If it meets the standard , The next performance test will continue , Understand system thresholds , Test whether the system has anti risk ability
- If it does not meet the standard, enter the performance diagnosis
such as :CPU Occupy too much , Response time decreases , Throughput drops , The occupation of hardware resources has increased
First, check that the process occupies too much memory , Check which thread in the process caused , From thread to code - Give optimization suggestions to developers
Tips : The following is the main body of this article , The following cases can be used for reference
Example 1: Homepage support 5 Concurrent users , Time in 3s Inside , The fault tolerance rate shall not exceed 2%
1、 New thread group
1、 Thread group is equivalent to user group , How many threads are equivalent to how many users , All samplers are under the thread group , All tasks are based on thread groups ;
2、ramp-up period It is the time required to start the set thread . If you choose 10 Threads , also ramp-up period yes 5 second , that JMeter Will use 5 Seconds make 10 Threads up and running .1s Just start two threads .( The time required to start the thread is set by yourself , It is set according to the server performance of the project , If the setting time is too short , Insufficient server performance , It will also affect the results of subsequent implementation )
3、 The cycle is the number of times the cycle is executed in the specified time . For example, the number of threads 10, Time is 5 second , loop 2 Time , in other words , Two threads will be executed in one second 2 Secondary cycle , One second concurrent 4 Requests ;
Support 5 Concurrent users , Setting the 5 Users
2、 Set up HTTP request
Setup protocol 、IP、 port 、 route
Take Baidu for example
3、 Set listener
- Number of users , First set the listener for the number of active threads (active threads)
- response time ——response over time
- Error rate —— Aggregation report
4、 start-up
5、 View results
1. First, check the number of active threads
Get close to... As soon as possible 5 s Start , The red line is nearly flat , All users are running , So when viewing the response time report , It should also start from 5s Start looking at ,20 end
2. Check response time
From 5 Seconds to check the response time , Maximum not exceeding 800 millisecond
3. Check the error rate
Open aggregate Report
The abnormal rate is 0, And percent 99 In the time of , The average response time is 133 millisecond , Meet the requirements of this performance test
Example 2: The response time of visiting the homepage shall not exceed 3s, How many concurrent users can be supported ?
Two kinds of schemes :
(1) Based on server performance , Estimate a maximum number of users , According to the test results , Add the number of original users ( Or minus ) Half of the original number of households (100 user , Performance has not reached the bottleneck , The number of people is 100+100/2=150), Know the maximum number of users obtained
(2) every other 10s Add a user
The second method is used here
1、 New thread group
Gradually pressurized thread groups are used ultimate thread group( It is more accurate than ordinary thread groups , Because the average value is taken when adding users to ordinary thread groups , As long as 10s Can be completed )
2、 add to http request
And examples 1 Agreement , It can be copied directly
3、 Listeners and results
The response time of visiting the homepage shall not exceed 3s, How many concurrent users can be supported
- Number of users , First set the listener for the number of active threads (active threads)
- The relationship between response time and the number of users (response times vs threads)
- error —— Aggregation report 、 View results
According to the above results, the number of users can be modified to the initial number of threads 700, Increase per second 5 Number of threads
Until finally 3s How many concurrent users are supported in
边栏推荐
- ECCV 2022 | semantic novelty detection based on relational reasoning
- 浅析IM即时通讯开发之扫码登录二维码
- MySQL表的增删查改(二)
- 簡單斐波那契
- 离线安装:如何搭建安全的企业级Harbor服务?内容太过详细。
- Review and Reflection on the development of this round of market 2021-04-05
- .NET6之MiniAPI(五):选项
- MoveIt2——7. 场景规划ROS API
- fiddler 抓包显示 ERR_TUNNEL_CONNECTION_FAILED
- DNS解析实验
猜你喜欢
随机推荐
这些超级好用的浏览器插件,还有很多人都不知道
ECCV 2022 | semantic novelty detection based on relational reasoning
Huawei wireless devices are configured with fast roaming between APs of the same service VLAN
多地市监部门展开冷饮抽检,钟薛高等产品均合格
What is CPU virtualization? Open or close?
数字化还没走远,数智化时代已经来临
【SwinTransformer源码阅读一】build_loader部分代码
真的卷不动了...
C语言文件操作
I really can't roll
Teach you to use cann to convert photos into cartoon style
Microservice architecture | link tracking - [sleuth]
教你使用CANN将照片一键转换成卡通风格
使用Flutter开发小程序+App)的一种组合思路
改善用户体验的404页面最佳实践
数据库之sqlite3 常用操作
华为无线设备配置同一业务VLAN的AP间快速漫游
【Flink】转换算子 filter
DNS解析实验
MoveIt2——10.URDF与SRDF