当前位置:网站首页>jmeter -- 分布式压测
jmeter -- 分布式压测
2022-07-05 04:35:00 【zyanwei2018】
需要分布式压测的场景
提高jmeter并发时,服务各环节均未达到瓶颈,但是接口的QPS不再等比增加,此时可能时压测机的配置和网络带宽等达到瓶颈。
在单台压测机配置和网络带宽达到瓶颈的情况下,为了达到QPS目标,一般会采用分布式压测的方案,即使用多台压力机,并使用主从模式保持并发发起的一致性。
linux压测机配置
配置准备
master节点
+ 需要上传:jmeter工具包、压测脚本、参数化文件(作为压测机时需要,放在apache-jmeter-*/bin/目录下) + vim apache-jmeter-*/bin/jmeter.properties文件 remote_hosts=ip1,ip2,ip3 (268行,master节点作压测机时也需配置ip,不能使用127.0.0.1)
slave节点
+ 需要上传:jmeter工具包(与master相同)、参数化文件(放在apache-jmeter-*/bin/目录下) + 不需要上传:压测脚本(master机会同步给slave机器) + vim apache-jmeter-*/bin/jmeter.properties文件 server.rmi.ssl.disable=true (345行,jmeter4.0版本以上需要修改改字段)
运行准备
启动压测机作为server
+ 如果master也需要作为压测机,也需要启动服务 + 进入apache-jmeter-*/bin目录,使用`./jmeter-server`命令启动压测机,监听master节点压测指令。当master节点也作为压测机时,也需要启动服务。 + 启动时,如果出现`Cannot start. xxx local is a loopback address`报错,则将bin/jmeter-server文件30行修改为`RMI_HOST_DEF=-Djava.rmi.server.hostname=当前节点ip`。
分布式运行
# 在apache-jmeter-*通级目录运行
mkdir report1
sh apache-jmeter-*/bin/jmeter.sh -n -t *.jmx -l test1.jtl -e -o report1/ -r
参数解析:
-n:非GUI模式执行Jmeter
-t:执行测试文件所在的位置及文件名
-l:指定生成测试结果的保存文件,jtl文件格式
-e:测试结束后,生成测试报告
-o:指定测试报告的存放位置,注意:执行命令前,report文件夹下内容必须清空,否则会报错
-r:启动所有在remote_hosts配置的服务器。注意:不需要分布式测试,只是单点就不输 -r 即可
边栏推荐
- Aperçu en direct | Services de conteneurs ACK flexible Prediction Best Practices
- 2022-2028 global and Chinese video coding and transcoding Market Research Report
- Scope of package class package
- Introduction to RT thread kernel (5) -- memory management
- [popular science] basic knowledge of thermal design: heat dissipation analysis of 5g optical devices
- [crampon programming] lintcode decoding Encyclopedia - 872 termination process
- All in one 1413: determine base
- Introduction to RT thread kernel (4) -- clock management
- 美国5G Open RAN再遭重大挫败,抗衡中国5G技术的图谋已告失败
- Here comes the Lantern Festival red envelope!
猜你喜欢
Construction d'un Cluster redis sous Windows
取余操作是一个哈希函数
【虚幻引擎UE】实现UE5像素流部署仅需六步操作少走弯路!(4.26和4.27原理类似)
How can CIOs use business analysis to build business value?
Function (basic: parameter, return value)
Cookie learning diary 1
Interview related high-frequency algorithm test site 3
Burpsuite grabs app packets
防护电路中的元器件
[phantom engine UE] the difference between running and starting, and the analysis of common problems
随机推荐
Neural networks and deep learning Chapter 6: Circular neural networks reading questions
【虚幻引擎UE】打包报错出现!FindPin错误的解决办法
可观测|时序数据降采样在Prometheus实践复盘
How to remove installed elpa package
Machine learning -- neural network
level18
[illusory engine UE] method to realize close-range rotation of operating objects under fuzzy background and pit recording
防护电路中的元器件
Mode in BST (binary tree & Notes on question brushing)
Discussion on the dimension of confrontation subspace
Scope of package class package
English topic assignment (27)
English topic assignment (26)
Ffmepg usage guide
Stage experience
Sequelize. JS and hasmany - belongsto vs hasmany in serialize js
介绍汉明距离及计算示例
American 5g open ran suffered another major setback, and its attempt to counter China's 5g technology has failed
【虚幻引擎UE】运行和启动的区别,常见问题分析
官宣!第三届云原生编程挑战赛正式启动!