Linux环境下jmeter 分布式压测
作者:互联网
需要一台控制机和N台代理机
修改配置文件:apache-jmeter-5.2/bin/jmeter.properties
1、代理机配置:
# Remote Hosts - comma delimited
remote_hosts=172.18.*.41 #设置为该机器的内网地址
#remote_hosts=localhost:1099,localhost:2010
# RMI port to be used by the server (must start rmiregistry with same port)
server_port=1099 #指定一个端口
# Set this if you don't want to use SSL for RMI
server.rmi.ssl.disable=true #打开
需要几个代理机就配置几个这样的配置
2、控制机配置:
# Remote Hosts - comma delimited
#remote_hosts=127.0.0.1
# 我配置了2个代理机用逗号隔开 指定代理机配置的端口,
remote_hosts=172.18.*.177:1099,172.18.*.41:1099
# RMI port to be used by the server (must start rmiregistry with same port)
# 端口
server_port=1099
# Set this if you don't want to use SSL for RMI
#打开
server.rmi.ssl.disable=true
#如果你需要的话,这些数据也可打开
#
# legitimate values: none, first, all
jmeter.save.saveservice.assertion_results=none
#
jmeter.save.saveservice.data_type=true
jmeter.save.saveservice.label=true
jmeter.save.saveservice.response_code=true
# response_data is not currently supported for CSV output
jmeter.save.saveservice.response_data=true
# Save ResponseData for failed samples
jmeter.save.saveservice.response_data.on_error=true
jmeter.save.saveservice.response_message=true
jmeter.save.saveservice.successful=true
jmeter.save.saveservice.thread_name=true
jmeter.save.saveservice.time=true
jmeter.save.saveservice.subresults=true
jmeter.save.saveservice.assertions=true
jmeter.save.saveservice.latency=true
# Only available with HttpClient4
jmeter.save.saveservice.connect_time=true
jmeter.save.saveservice.samplerData=true
jmeter.save.saveservice.responseHeaders=true
jmeter.save.saveservice.requestHeaders=true
jmeter.save.saveservice.encoding=true
jmeter.save.saveservice.bytes=true
# Only available with HttpClient4
#jmeter.save.saveservice.sent_bytes=true
#jmeter.save.saveservice.url=true
#jmeter.save.saveservice.filename=false
#jmeter.save.saveservice.hostname=false
#jmeter.save.saveservice.thread_counts=true
#jmeter.save.saveservice.sample_count=false
#jmeter.save.saveservice.idle_time=true
3、先启动代理机
启动脚本:jmeter-server -Djava.rmi.server.hostname=172.18.*.41
几个代理机就启动几个
4、然后启动控制机
启动脚本:sh /data/apache-jmeter-5.2/bin/jmeter.sh -n -t test_Connect_t1000_f20.jmx -r -l test_result.jtl -e -o test_result_record >test_result.log
参数说明:
n:非gui运行
t:指定测试脚本 *.jmx
R:指定多少个 agent 启动并参与测试
r: 代表全部 agent 启动并参与测试(我采用的是全部)
l:生成测试结果文件
-e -o:生成图文可视化的测试报告页面
*饼饼* 发布了184 篇原创文章 · 获赞 17 · 访问量 22万+ 私信 关注
标签:jmeter,压测,server,Linux,save,true,port,saveservice 来源: https://blog.csdn.net/Hedy17/article/details/104409105