分布式压测(联机负载)
性能测试
1、性能监控图形的设置
2、设置思考时间think time , 请求之间的间隔时间,模拟真实的用户行为
3、并发测试
设置集合点,实现真正意义的并发
4、使用负载测试线程组实现负载测试
分布式压测
角色:
- 被测服务端: 192.168.30.62
- 控制机: 192.168.30.36
- 负载机: 192.168.30.160 192.168.30.113 192.168.30.33 192.168.30.18 192.168.30.10 192.168.30.35 192.168.30.13
配置文件的设置:
jmeter.properties
1、控制机:
# Remote Hosts - comma delimited
# 设置负载机的ip地址和端口号
remote_hosts=192.168.30.160:1099,192.168.30.18:1099,192.168.30.10:1099
#remote_hosts=localhost:1099,localhost:2010
# Set this if you don't want to use SSL for RMI
server.rmi.ssl.disable=true
# Remote batching support
# Since JMeter 2.9, default is MODE_STRIPPED_BATCH, which returns samples in
# batch mode (every 100 samples or every minute by default)
# Note also that MODE_STRIPPED_BATCH strips response data from SampleResult, so if you need it change to
# another mode
# Batch returns samples in batches
# Statistical returns sample summary statistics
# mode can also be the class name of an implementation of org.apache.jmeter.samplers.SampleSender
mode=Standard
2、负载机
# RMI port to be used by the server (must start rmiregistry with same port)
server_port=1099
# To use a specific port for the JMeter server engine, define
# the following property before starting the server:
server.rmi.localport=1099
# Set this if you don't want to use SSL for RMI
server.rmi.ssl.disable=true
3、负载机启动 jmeter-server.bat
负载机拷贝参数文件到JMeter下的同位置
4、在控制机启动负载测试
命令行启动:
jmeter -n -t demo_06_miaosha.jmx -l test_result -e -o test_report
-R 指定负载机, 会覆盖配置文件remotehosts里的负载机
jmeter -n -R 192.168.30.10:1099,192.168.30.12:1099 -t demo_06_miaosha.jmx -l test_result -e -o test_report