压力测试(八)-多节点JMeter分布式压测实战

时间:2021-10-12 00:15:53

1、Jmeter4.0分布式压测准备工作

简介:讲解Linux服务器上jmeter进行分布式压测的相关准备工作

1、压测注意事项

the firewalls on the systems are turned off or correct ports are opened.

系统上的防火墙被关闭或正确的端口被打开。

all the clients are on the same subnet.

所有的客户端都在同一个子网上。

the server is in the same subnet, if 192.x.x.x or 10.x.x.x IP addresses are used. If the server doesn't use 192.xx or 10.xx IP address, there shouldn't be any problems.

如果使用192.x.x.x或10.x.x.x IP地址,则服务器位于同一子网中。 如果服务器不使用192.xx或10.xx IP地址,则不应该有任何问题。

Make sure JMeter can access the server.

确保JMeter可以访问服务器。

Make sure you use the same version of JMeter and Java on all the systems. Mixing versions will not work correctly.

确保在所有系统上使用相同版本的JMeter和Java。 混合版本将无法正常工作。

You have setup SSL for RMI or disabled it.

您已为RMI设置SSL或将其禁用。

官网地址 http://jmeter.apache.org/usermanual/jmeter_distributed_testing_step_by_step.html

压测注意事项:一定要用内网IP,不用用公网IP,用ping去检查

2、专业名字

master:司令

slave:奴隶

target:目标

地址:http://jmeter.apache.org/images/screenshots/distributed-names.svg

地址:http://jmeter.apache.org/images/screenshots/distributed-jmeter.svg

远程拷贝(内网地址):

scp -r /usr/local/software/jdk-8u141-linux-x64.tar.gz root@172.18.230.233:/usr/local/software

scp -r /usr/local/software/jmeter/apache-jmeter-4.0.tgz root@172.18.230.233:/usr/local/software/jmeter

启动

./jmeter-server 或者    nohup ./jmeter-server &

检查启动是否成功

ps -ef|grep jmeter-server

ps aux|grep jmeter-server

2、阿里云jmeter压测常见问题处理

简介:讲解阿里云上安装jmeter常见问题的处理,安装遇到的问题等等

(备注:内容较多,放在笔记最下方)

3、Jmeter4.0分布式压测实战

简介:Jmeter分布式压测实战,压测接口

1、关注CPU和内存使用

本地非GUI分布式压测 -r

jmeter -n -t /Users/jack/Desktop/remote.jmx -r -l /Users/jack/Desktop/jtl/result.jtl -e -o /Users/jack/Desktop/result

压测结果

./jmeter -n -t /Users/jack/Desktop/remote.jmx -r -l /Users/jack/Desktop/jtl/result.jtl -e -o /Users/jack/Desktop/result

Creating summariser <summary>

Created the tree successfully using /Users/jack/Desktop/remote.jmx

Configuring remote engine: 172.20.10.3:8899

Using local port: 8899

Configuring remote engine: 172.20.10.11:8899

Starting remote engines

Starting the test @ Thu Mar 29 23:21:13 CST 2018 (1522336873931)

Remote engines have been started

Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445

summary =      4 in 00:00:22 =    0.2/s Avg:  5582 Min:    94 Max: 21006 Err:     1 (25.00%)

Tidying up remote @ Thu Mar 29 23:21:36 CST 2018 (1522336896842)

... end of run

2、压测修改master节点信息

jemeter.properties 值是slave机器的ip+端口号,如果有多个,用逗号分隔

remote_hosts=192.168.0.102:8899,192.168.0.101:8899

server.rmi.ssl.disable=true (前面有说到)

3、启动slave机器,注意要同个网段,ip地址用内网ip

./jmeter-server

Using local port: 8899

Created remote object: UnicastServerRef2 [liveRef: [endpoint:[192.168.0.102:8899](local),objID:[3a585a4d:162724586ab:-7fff, 3963132813614033916]]]

相关资料:

https://www.cnblogs.com/Fine-Chan/p/6233823.html

https://blog.csdn.net/liujingqiu/article/details/52635289

https://www.cnblogs.com/puresoul/p/4844539.html