当前位置:网站首页>jmeter concurrency and some limitations of the press
jmeter concurrency and some limitations of the press
2022-08-09 07:03:00 【A beautiful cat】
What do I need to know as a test?It doesn't need to be too difficult, but you can't understand everything. If you don't understand it, you can't make a correct test. If you know what will affect the test results, you need to understand it yourself, and I don't understand it either.
One, the difference between thread and process
Thread: Thread (English: thread) is the smallest unit that the operating system can perform operation scheduling.It is contained in the process and is the actual operating unit in the process.
We saw there is a thread group in jmeter, hey, this is the thing
Q: Is an http request a thread?A: Yes, an http request is a threadQ: Does the Java service open a new thread every time it receives a request?A: It is restricted by the "maximum number of threads" and "number of accepted queued requests" started by tomcat.When the number of threads that have been opened is less than the "maximum number of threads", a request will naturally come, and a thread will be opened to process the request.However, once the maximum number of threads is exceeded and the number of queues is less than the allowable number of queues, it can be queued there, waiting for the execution of the previous request to complete, and the threads will be vacated and then allocated to these waiting requests.And if the waiting http request is already equal to the number of allowed waiting, the request will be rejected directly.
Process: Process - the smallest unit of resource allocation. When we open a browser, we actually open a process, which will be loaded into the memory space and logically generate an independent instance, which is a process.
When I open 2 jmeter page programs, there are two java programs in the process of resource manager
When I add thread group and thread in any jmeter, the process does not increase.This is because multiple threads can run concurrently in a process.
2. How many concurrent threads can jmeter support
Q: What is the maximum number of threads that a process can allow in the WINDOWS operating system?
A: By default, the stack of a thread should reserve 1M memory space
And the memory space available in a process is only 2G, so theoretically a process can open up to 2048 threads
Q: How many threads can one process run in the Linux operating system?A: Each process has its own private user space (0-3G), which is invisible to other processes in the system.When each process runs, it will get 4G of virtual memory. Under 32-bit Linux, 3G is given to the user, and 1G is given to the kernel.Q: Does it mean that a jmeter process starts 2048 threads?A: It is only in theory, but of course the memory cannot be completely used as the thread stack, so the actual number is smaller than this value. You can also modify the default stack size when connecting, and change it to a smaller value, so that you canOpen some more threads.If the default stack size is changed to 512K, in theory, up to 4096 threads can be opened.Q: What is the calculation method of jmeter average response time and TPS?A: Average response time = response time of all samples and / number of samplesFor example: 20s/100 pieces = 0.2sTPS=(sample number)/(end time - start time)For example: 100/2s = 50tps/sQ: How to control the concurrent number issued by jmeter?A: When the number of threads is 100, the run_up time is 1s. If the average response time is less than 1s, the number of threads can be increased, which does not exceed the theoretical value of 2048 threads.Because the calculation method of tps is calculated in seconds, in fact, the average response time of less than 3s is within the acceptable range.Blindly pursuing tps data has requirements for servers, presses, and network bandwidth. If you want to achieve too high tps at 1M bandwidth, it is undoubtedly a nonsense.Q: How many threads can be supported by how much bandwidth?A: 1Mbps broadband can theoretically transmit 128kb of data. The specific calculation method is 1*1024 = 1024KB. The conversion of 1Mbps bit into byte is 8:1, then 1024/8=128KBIf an http request, the request data is 50 Chinese characters, then 128KB*1024/(50*2) (one Chinese character 2 bytes) = 1310 requests/sIf there are 10 requests per second, it is 1310/10=131 requests/s!Note: This is also the theoretically achievable number of processing requests. Depending on the size of the requested image and data volume, the data fluctuates.Users may download pictures, and the size of the pictures downloaded once per second is 10kb, and the calculation formula is 128/10 = 12.8 peopleQ: Then do we still need to pay attention to the cpu and other information of the test press?A: This is for sure. When the cpu is occupied by other programs, the threads in the process cannot obtain enough cpu memory and other support, and it will also block the queue and affect the test results. It is best to maintain the occupancy rate of the cpu to 80% or less, to ensure that the request origination of the press itself is valid and not lost.Also confirm that the program has launched enough threads.Q: Why I didn't start too many threads, but jmeter reported an error stack overflow?A: You can modify the jmeter memory parameter settings, edit jmeter.bat set HEAP=-Xms1g -Xmx1g -XX:MaxMetaspaceSize=1024m After saving (multiple of 1024), open jconsole to check whether the modification is successful, you can also check before modification
边栏推荐
- The singleton pattern
- 细谈VR全景:数字营销时代的宠儿
- car-price-deeplearning-0411
- 找不到和chrome浏览器版本不同的chromedriver的解决方法
- io.lettuce.core。RedisCommandTimeoutException命令超时
- 基于布朗运动的文本生成方法-LANGUAGE MODELING VIA STOCHASTIC PROCESSES
- 分布式事务的应用场景
- way of thinking problem-solving skills
- makefile记录
- Explain the wait() function and waitpid() function in C language in detail
猜你喜欢
Mysql实操
学习小笔记---机器学习
买口罩(0-1背包)
更改Jupyter Notebook默认打开目录
基于布朗运动的文本生成方法-LANGUAGE MODELING VIA STOCHASTIC PROCESSES
用tensorflow.keras模块化搭建神经网络模型
排序第一节——插入排序(直接插入排序+希尔排序)(视频讲解26分钟)
The working principle of the transformer (illustration, schematic explanation, understand at a glance)
DSP+ARM+FPGA高速PCIE/千兆网口信号仿真介绍
Search 1688 product interface by image (item_search_img-search 1688 product by image (Politao interface) code docking tutorial
随机推荐
APP product source data interface (taobao, jingdong/spelling/suning/trill platform details a lot data analysis interface) code and docking tutorial
高项 04 项目整体管理
bzoj 5333 [Sdoi2018]荣誉称号
AD的library中 库文件后缀有.intlib .schlib .pcblib 的区别
car-price-deeplearning-0411
【MySQL】update mysql.user set authentication_string=password(“123456“) where User=‘root‘; 报错
Simple Factory Pattern
Altium designer software commonly used the most complete package library, including schematic library, PCB library and 3D model library
Rsync常见错误
神经网络优化器
长沙学院2022暑假训练赛(一)六级阅读
找出数组中不重复的值php
leetcode 之 零移位
The water problem of leetcode
排序第一节——插入排序(直接插入排序+希尔排序)(视频讲解26分钟)
TCP段重组PDU
Leetcode 70 stairs issues (Fibonacci number)
Forest Program dfs+tanjar仙人掌
2022 年全球十大最佳自动化测试工具
常见的分布式事务解决方案