当前位置:网站首页>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
边栏推荐
- Import the pycharm environment package into another environment
- SSL证书最长有效期13个月,还有必要一次申请多年吗?
- Transaction concluded
- 【Oracle 11g】Redhat 6.5 安装 Oracle11g
- 2017 G icpc shenyang Infinite Fraction Path BFS + pruning
- 变压器的工作原理(图解,原理图讲解,一看就懂)
- MVN 中配置flyway mysq
- 细谈VR全景:数字营销时代的宠儿
- 长沙学院2022暑假训练赛(一)六级阅读
- imageio读取.exr报错 ValueError: Could not find a backend to open `xxx.exr‘ with iomode `r`
猜你喜欢
jvm线程状态
Fragments
基于布朗运动的文本生成方法-LANGUAGE MODELING VIA STOCHASTIC PROCESSES
分布式事务产生的原因
【修电脑】系统重装但IP不变后VScode Remote SSH连接失败解决
unity第一课
Flask failed to create database without error
Search 1688 product interface by image (item_search_img-search 1688 product by image (Politao interface) code docking tutorial
【模板】树链剖分 P3384
jmeter并发数量以及压力机的一些限制
随机推荐
APP product source data interface (taobao, jingdong/spelling/suning/trill platform details a lot data analysis interface) code and docking tutorial
Tkinter可以选择的颜色
分布式事务产生的原因
Introduction and use of BeautifulSoup4
TCP段重组PDU
学习小笔记---机器学习
2022年7月小结
ByteDance Interview Questions: Mirror Binary Tree 2020
postgresql窗口功能
leetcode 之盛水问题
composer 内存不足够
AD画PCB板教程 20分钟讲清楚操作流程 铺铜 网络标号
字节跳动笔试题2020 (抖音电商)
MySQL高级特性之分布式(XA)事务的介绍
SAP ALV 数据导出被截断的bug
找出数组中不重复的值php
排序第三节——交换排序(冒泡排序+快速排序+快排的优化)(5个视频讲解)
分布式理论
The singleton pattern
The working principle of the transformer (illustration, schematic explanation, understand at a glance)