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 Files\RabbitMQ Server\rabbitmq-perf-test-1.1.0\bin
> 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 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM