当前位置:网站首页>The CSV used for JMeter performance test is bullshit
The CSV used for JMeter performance test is bullshit
2022-06-12 01:10:00 【Xiaowu knock code】
Many people are using jmeter Do interface tests 、 Automated testing and performance testing , All like to use CSV Data file setting function , To read the prepared test data . Although this method is not the best solution , In our performance testing course , Explained a better scheme , however , Testers who haven't taken our class , It is still widely used CSV The way .
today , Let's tell you a story about CSV Prepare a huge pit of test data and solutions .
jmeter Do a test , To read the prepared test data file , If you only think of CSV This is a way , Then use ‘CSV Data Set Config’ This component , Never use csvRead function , Use this function , You've been killed , Please don't say I didn't remind you .
however , Use ‘CSV Data Set Config’ This component , You can only start from... At a time 1 Start reading row data , Or ignore the first line from 2 OK, let's start , There's no way to start from scratch .
Every time from 1 Line start value , In daily low concurrency performance testing , There is no problem , Because you only need to run one jmeter Can , however , If you want to do high concurrency performance testing , There need to be multiple jmeter Running at the same time , Form a distributed to make requests to the server , Now there's a problem .
because , Distributed , Run simultaneously on multiple machines jmeter, Every machine will start from 1 Line start reading the test file you prepared , that , At the same time, multiple threads use the same test data to make requests to the server , This is likely to lead to various exceptions in your tested service .
Have you ever used distributed for performance testing , There are many 4xx Series error , The performance test performed by a single machine does not ; Have you ever appeared , The error rate increases when distributed , And when it's stand-alone , Same concurrent number , The error rate is much lower ; Have you ever appeared , Distributed request , Server log , There are a lot of lock conflicts ?
These problems , If you use... In your script ‘CSV Data Set Config’, So these mistakes , It is probably because this component can only read data from the... Every time 1 The reason why the line starts reading .
The pit , I once met , And it once made me miserable for a few days , however , Then I found 4 A solution , today , Let me tell you a method with the lowest technical difficulty .
️ open jmeter Plug in management , stay ‘available plugins’ Mid search ‘CSV’, Check one called ‘Random CSV Data Set’ Plug in for , Click on the ‘Apply Changes and Restart JMeter’ Download and install this plug-in . After downloading successfully and restarting automatically , stay jmeter In the configuration element of , We will find ‘bzm - Random CSV Data Set Config’ Components .
You can click ** Below ‘Test CSV Reading’ Let's look at the order of the data , You'll find that , The data order is different every time .** such , This solves the problem of the same data retrieval when distributed . The method is very simple .
Next , Let's compare the performance of this component .
First add ‘CSV Data Set Config’ Components , Read a copy greater than 10000 Row data file , Define a variable to receive , then , Use a debug sampler , Apply this variable , Located in 1000 Concurrent users , Keep running 120s, Save script , use CLI mode , View runtime resource usage .

From monitoring to data ,1000 Concurrent ,120 In seconds , In all 59830295 Requests , Average per second 498141.6 Time /s, My own machine CPU The utilization rate rose to about 48.3%, Memory usage is about 26.8%.
Now? , Replace the components with ‘bzm - Random CSV Data Set Config’, Everything else remains the same . use CLI Mode to run , View monitoring data .

From monitoring to data ,1000 Concurrent ,120 In seconds , In all 20860718 Requests , Average per second 172912.8 Time /s, My own machine CPU The utilization rate rose to about 66.5%, Memory usage is about 26.7%.
️ From the test results of the two components , Official CSV Data Set Config Performance is better than bzm - Random CSV Data Set Config, In practice , You can choose according to your actual situation .
Finally, thank everyone who reads my article carefully , The following online link is also a very comprehensive one that I spent a few days sorting out , I hope it can also help you in need !

These materials , For those who want to change careers 【 software test 】 For our friends, it should be the most comprehensive and complete war preparation warehouse , This warehouse also accompanied me through the most difficult journey , I hope it can help you ! Everything should be done as soon as possible , Especially in the technology industry , We must improve our technical skills . I hope that's helpful ……
If you don't want to grow up alone , Unable to find the information of the system , The problem is not helped , If you insist on giving up after a few days , You can click the small card below to join our group , We can discuss and exchange , There will be various software testing materials and technical exchanges .
| Click the small card at the end of the document to receive it |
Typing is not easy , If this article is helpful to you , Click a like, collect a hide and pay attention , Give the author an encouragement . It's also convenient for you to find it quickly next time .
Self study recommendation B Stop video :
Zero basis transition software testing :25 Days from zero basis to software testing post , I finished today , Employment tomorrow .【 Include features / Interface / automation /python automated testing / performance / Test Development 】
Advanced automation testing :2022B The first station is super detailed python Practical course of automated software testing , Prepare for the golden, silver and four job hopping season , After advanced learning, it soared 20K
边栏推荐
- Devops landing practice drip and pit stepping records - (1)
- Matlab 基础应用02 wind 股票数据介绍和使用案例:
- 2022 edition of global and Chinese on silicon liquid crystal market supply and demand research and prospect Trend Forecast Report
- Henan Zhongchuang - from cloud to edge, how edge computing enables data centers
- How much is the child's critical illness insurance coverage appropriate? Which product is better now
- Research Report on development status and investment suggestions of o-tert-butyl cyclohexyl acetate Market in the world and China 2022-2028
- 中创专利|中国5G标准必要专利达1.8万项,尊重知识产权,共建知识产权强国
- System.CommandLine选项Option
- [path of system analysts] summary of real problems of system analysts over the years
- C language pointer and array - learning 23
猜你喜欢

Go out with a stream

新知识:Monkey 改进版之 App Crawler

Verification code is the natural enemy of automation? Let's see how Ali P7 solved it

One article to show you how to understand the harmonyos application on the shelves

Weibull Distribution韦布尔分布的深入详述(2)参数和公式意义

How can functional tests be quickly advanced in one month? It is not a problem to clarify these two steps

Xiaomu's interesting PWN

Nat. Comm. | supercomputing +ai: providing navigation for natural product biosynthesis route planning

我在某大厂做软件测试工程师的《一天完整工作流程》

一文get,最容易碰上的接口自动化测试问题汇总
随机推荐
Weibull Distribution韦布尔分布的深入详述(1)原理和公式
Forecast report on industry operation and development strategy of global and Chinese suspension control station industry 2022-2028
'virtue and art' in the field of recurrent+transformer video recovery
Such a change in people's understanding of the industrial Internet is not achieved overnight
websocket服务器实战
A knowledge map (super dry goods, recommended collection!)
Lambda中间操作limit
Yixin Huachen talks about how to do a good job in customer master data management
2022 edition of global and Chinese high purity silicon carbide powder operation research and investment strategy analysis report
Is interface automation difficult? Take you from 0 to 1 to get started with interface automation test [0 basic can also understand series]
【SignalR全套系列】之在.Net6中实现SignalR分组通信
Esp8266wifi development board collects temperature and humidity data and uploads them to the Internet of things platform
jmeter 性能测试用 csv,这个坑有些扯蛋
[answer] what does UML use to represent hexagonal architecture
[工具] spacing.js 测间距
Lambda创建流
2022-06-11:注意本文件中,graph不是邻接矩阵的含义,而是一个二部图。 在长度为N的邻接矩阵matrix中,所有的点有N个,matrix[i][j]表示点i到点j的距离或者权重, 而在二部
验证码是自动化的天敌?看看阿里P7大神是怎么解决的
C language pointer and array - learning 23
Lambda create stream