如何测试 rabbitmq 的性能
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何测试 rabbitmq 的性能相关的知识,希望对你有一定的参考价值。
测试 rabbitmq 的性能方法如下:
1、声明7个具有不同属性的queue,分别和名为test_exchage的exchange进行绑定(因为exchange为fanout类型,所以测试代码中的routing_key其实是不起作用的);
2、向exchange发送具有persistent属性的消息(delivery_mode=2);
3、创建7个消费者分别从上述7个queue中获取消息;
4、测试结果如下
参考技术A rabbitmq发送:持久化rabbitmq send perf,exchange:exchange_durable concurrency:8 bodySize:1 cost:10587 count:200000 all_tps:18891 per_thread_tps:2361
rabbitmq send perf,exchange:exchange_durable concurrency:16 bodySize:1 cost:11507 count:200000 all_tps:17380 per_thread_tps:1086
rabbitmq send perf,exchange:exchange_durable concurrency:8 bodySize:40 cost:18128 count:200000 all_tps:11032 per_thread_tps:1379
rabbitmq send perf,exchange:exchange_durable concurrency:16 bodySize:40 cost:20078 count:200000 all_tps:9961 per_thread_tps:622
rabbitmq send perf,exchange:exchange_durable concurrency:8 bodySize:1024 cost:20367 count:200000 all_tps:9819 per_thread_tps:1227
rabbitmq send perf,exchange:exchange_durable concurrency:16 bodySize:1024 cost:35198 count:200000 all_tps:5682 per_thread_tps:355
rabbitmq send perf,exchange:exchange_durable concurrency:8 bodySize:4096 cost:32366 count:200000 all_tps:6179 per_thread_tps:772
rabbitmq send perf,exchange:exchange_durable concurrency:16 bodySize:4096 cost:30131 count:200000 all_tps:6637 per_thread_tps:414
rabbitmq发送:内存
rabbitmq send perf,exchange:exchange_memory concurrency:8 bodySize:1 cost:15237 count:200000 all_tps:13125 per_thread_tps:1640
rabbitmq send perf,exchange:exchange_memory concurrency:16 bodySize:1 cost:25250 count:200000 all_tps:7920 per_thread_tps:495
rabbitmq send perf,exchange:exchange_memory concurrency:8 bodySize:40 cost:21659 count:200000 all_tps:9234 per_thread_tps:1154
rabbitmq send perf,exchange:exchange_memory concurrency:16 bodySize:40 cost:29767 count:200000 all_tps:6718 per_thread_tps:419
rabbitmq send perf,exchange:exchange_memory concurrency:8 bodySize:1024 cost:23179 count:200000 all_tps:8628 per_thread_tps:1078
rabbitmq send perf,exchange:exchange_memory concurrency:16 bodySize:1024 cost:25697 count:200000 all_tps:7783 per_thread_tps:486
rabbitmq send perf,exchange:exchange_memory concurrency:8 bodySize:4096 cost:33315 count:200000 all_tps:6003 per_thread_tps:750
rabbitmq send perf,exchange:exchange_memory concurrency:16 bodySize:4096 cost:44626 count:200000 all_tps:4481 per_thread_tps:280
rabbitmq接收:持久化
rabbitmq receive perf,queue:queue_durable concurrency:8 prefetchCount:1 cost:9732 count:200000 all_tps:20550 per_thread_tps:2568
rabbitmq receive perf,queue:queue_durable concurrency:8 prefetchCount:50 cost:51346 count:200000 all_tps:3895 per_thread_tps:486
rabbitmq receive perf,queue:queue_durable concurrency:8 prefetchCount:1000 cost:54912 count:200000 all_tps:3642 per_thread_tps:455
rabbitmq receive perf,queue:queue_durable concurrency:16 prefetchCount:1 cost:45727 count:200000 all_tps:4373 per_thread_tps:273
rabbitmq receive perf,queue:queue_durable concurrency:16 prefetchCount:50 cost:47320 count:200000 all_tps:4226 per_thread_tps:264
rabbitmq receive perf,queue:queue_durable concurrency:16 prefetchCount:1000 cost:48504 count:200000 all_tps:4123 per_thread_tps:257
rabbitmq接收:内存
rabbitmq receive perf,queue:queue_memory concurrency:8 prefetchCount:1 cost:59068 count:200000 all_tps:3385 per_thread_tps:423
rabbitmq receive perf,queue:queue_memory concurrency:8 prefetchCount:50 cost:59263 count:200000 all_tps:3374 per_thread_tps:421
rabbitmq receive perf,queue:queue_memory concurrency:8 prefetchCount:1000 cost:64494 count:200000 all_tps:3101 per_thread_tps:387
rabbitmq receive perf,queue:queue_memory concurrency:16 prefetchCount:1 cost:62567 count:200000 all_tps:3196 per_thread_tps:199
rabbitmq receive perf,queue:queue_memory concurrency:16 prefetchCount:50 cost:64184 count:200000 all_tps:3116 per_thread_tps:194
rabbitmq receive perf,queue:queue_memory concurrency:16 prefetchCount:1000 cost:64630 count:200000 all_tps:3094 per_thread_tps:193
以上是关于如何测试 rabbitmq 的性能的主要内容,如果未能解决你的问题,请参考以下文章
如何进行RabbitMQ Cluster的性能测试以进行进一步的微调?
RabbitMQ Performance Testing Tool 性能测试工具