RabbitMQ Performance Testing Tool 性能测试工具

Posted saryli

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了RabbitMQ Performance Testing Tool 性能测试工具相关的知识,希望对你有一定的参考价值。

RabbitMQ Performance Testing Tool 介绍:
https://www.rabbitmq.com/java-tools.html

 

RabbitMQ Performance Testing Tool 下载:
https://github.com/rabbitmq/rabbitmq-perf-test/releases

 

解压文件(放到 RabbitMQ 安装目录下)
rabbitmq-perf-test-1.1.0.zip

 

测试(命令行执行):

> cd D:Program FilesRabbitMQ Server
abbitmq-perf-test-1.1.0in
> runjava.bat com.rabbitmq.perf.PerfTest -a


更多帮助:

> runjava com.rabbitmq.perf.PerfTest --help
usage: <program>
 -?,--help                         show usage
 -A,--multiAckEvery <arg>          multi ack every
 -a,--autoack                      auto ack
 -b,--heartbeat <arg>              heartbeat interval
 -C,--pmessages <arg>              producer message count
 -c,--confirm <arg>                max unconfirmed publishes
 -D,--cmessages <arg>              consumer message count
 -d,--id <arg>                     test ID
 -e,--exchange <arg>               exchange name
 -f,--flag <arg>                   message flag
 -h,--uri <arg>                    connection URI
 -i,--interval <arg>               sampling interval in seconds
 -K,--randomRoutingKey             use random routing key per message
 -k,--routingKey <arg>             routing key
 -M,--framemax <arg>               frame max
 -m,--ptxsize <arg>                producer tx size
 -n,--ctxsize <arg>                consumer tx size
 -p,--predeclared                  allow use of predeclared objects
 -Q,--globalQos <arg>              channel prefetch count
 -q,--qos <arg>                    consumer prefetch count
 -R,--consumerRate <arg>           consumer rate limit
 -r,--rate <arg>                   producer rate limit
 -s,--size <arg>                   message size in bytes
 -t,--type <arg>                   exchange type
 -u,--queue <arg>                  queue name
 -X,--producerChannelCount <arg>   channels per producer
 -x,--producers <arg>              producer count
 -Y,--consumerChannelCount <arg>   channels per consumer
 -y,--consumers <arg>              consumer count
 -z,--time <arg>                   run duration in seconds (unlimited by default)
 


示例:100个生产者;100个消费者;echange名称为testex;转发类型为fanout;queue名称为testque;bingding为kk01;

runjava.bat com.rabbitmq.perf.PerfTest -x100 -y100 -e"testex" -t"fanout" -u"testque" -k"kk01"

使用PerfTest

运行PerfTest的最基本的方法只是指定要连接的URI,要使用的发布者(比如说1)和一些消费者(比如2)。请注意,RabbitMQ Java客户端可以实现较高的发布速率(每个连接每秒高达80至90K条消息),给予足够的带宽,并且当某些安全措施(发行商确认)被禁用时,很少需要过度配置发布者(除非这是特定的测试目标)。

bin/runjava com.rabbitmq.perf.PerfTest -x 1 -y 2 -u "throughput-test-1" -a --id "test 1"

使用2个发布者和4个消费者:

bin/runjava com.rabbitmq.perf.PerfTest -x 2 -y 4 -u "throughput-test-2" -a --id "test 2"

此修改将消费者切换到手动确认:

bin/runjava com.rabbitmq.perf.PerfTest -x 1 -y 2 -u "throughput-test-3" --id "test 3"

修改将消息大小从默认(12字节)更改为4 kB:

bin/runjava com.rabbitmq.perf.PerfTest -x 1 -y 2 -u "throughput-test-4" --id "test 4" -s 4000
使用持久队列和持久消息:
bin/runjava com.rabbitmq.perf.PerfTest -x 1 -y 2 -u "throughput-test-5" --id "test-5" -f persistent

  

--------------------- 本文来自 辛修灿 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/u012743772/article/details/78827135?utm_source=copy 


结合 rabbitmq-management界面工具查看,和了解消息收发情况(参考:RabbitMQ 在windows中安装) --------------------- 本文来自 Huang-ZC 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/kk185800961/article/details/55252797?utm_source=copy 







以上是关于RabbitMQ Performance Testing Tool 性能测试工具的主要内容,如果未能解决你的问题,请参考以下文章

Performance testing test scenarios

[TEST123] Performance Test

性能测试 Performance Test Report

Visual Studio的Web Performance Test提取规则详解

Guideline 2.3.1 - Performance

什么是Performance