分布式压测怎么做
原理
1、Jmeter分布式测试时,选择其中一台作为控制机(Controller),其它机器做为代理机(Agent)。
2、执行时,Controller会把脚本发送到每台Agent上,Agent 拿到脚本后开始执行,Agent执行时不需要启动Jmeter,只需要把jmeter-server.bat文件打开,它应该是通过命令行模式来执行的。
3、执行后,Agent会把结果回传给Controller,Controller会收集所有Agent的信息并汇总
图形解释

步骤
1.CMD里输入IPCONFIG查出IP地址

2.执行机:打开Jmeter/bin/jmeter.properties,找到”remote_hosts=127.0.0.1”,把这一行修改为”remote_hosts=192.168.8.149:1099,1099是端口号,可以随意自定义。启动执行机jmter-server.bat 执行机就算完成了

3.控制机:打开Jmeter/bin/jmeter.properties,找到”remote_hosts=127.0.0.1”,把这一行修改为”remote_hosts=192.168.8.149:1099,192.168.8.174:1099,1099是端口号,可以随意自定义。如果有多台代理机,这里需要把所有的代理机的IP地址和端口号都加进来,用逗号分隔。
启动控制机 jmeter-server.bat

编写脚本
1.添加线程组 设置线程组100 循环次数2
写好请求--添加好断言以及聚合报告

2.点击菜单栏运行

3.查看聚合报告

网友评论