A quick message queue benchmark: ActiveMQ, RabbitMQ, HornetQ, QPID, Apollo
2015-06-11 10:45
429 查看
Lately I performed a message queue benchmark, comparing several queuing frameworks (RabbitMQ, ActiveMQ…).
Those benchmarks are part of a complete study conducted by Adina
Mihailescu, and everything was presented at the April
2013 riviera.rb meet-up. You should definitely peek into Adina’s great presentation available online right
here.
So I wanted to benchmark brokers, using different protocols: I decided to build a little Rails application piloting a binary that was able to enqueue/dequeue
items taken from a MySQL database.
![](http://blog.x-aeon.com/wp-content/uploads/2013/04/Setup.png)
I considered the following scenarios:
Scenario A: Enqueuing 20,000 messages of 1024 bytes
each, then dequeuing them afterwards.
Scenario B: Enqueuing and dequeuing simultaneously 20,000 messages
of1024 bytes each.
Scenario C: Enqueuing and dequeuing simultaneously 200,000 messages
of32 bytes each.
Scenario D: Enqueuing and dequeuing simultaneously 200 messages
of32768 bytes each.
For each scenario, 1 process is dedicated to enqueuing, and another one is dedicated to dequeuing.
I measured the time spent by each enqueuing and dequeuing process, with 2 different broker configurations:
Using persistent queues and messages (when the broker is down and back up, queues are still containing items).
Using transient queues and messages (no persistence: when broker is down, queues and items are lost).
I decided to bench the following brokers:
ActiveMQ
5.8.0 with STOMP protocol
RabbitMQ
3.0.2 with STOMP and AMQP protocols
HornetQ
2.3.0 with STOMP protocol
Apollo
1.6 with STOMP protocol
QPID
0.20 (Java broker) with AMQP protocol
A home-made ZeroMQ
2.2.0 broker, working in memory only (no persistence).
The tests were run on a single laptop with this configuration:
Model: Dell Studio 1749
CPU: Intel Core i3 @ 2.40 GHz
RAM: 4 Gb
OS: Windows 7 64 bits
Ruby 1.9.3p392
Java 1.7.0_17-b02
Ruby AMQP client gem: amqp 0.9.10
Ruby STOMP client gem: stomp 1.2.8
Ruby ZeroMQ gem: ffi-rzmq 1.0.0
Apart from declaring the testing queues in some brokers’ configuration and the persistence settings, all brokers were running with their default configurationout
of the box (no tuning made).
You can find all the source code used to perform those benchmarks here
on github.
And now, the results (processing time measured in seconds: the lower the better).
![](http://blog.x-aeon.com/wp-content/uploads/2013/04/ScenarioA.png)
![](http://blog.x-aeon.com/wp-content/uploads/2013/04/ScenarioB2.png)
![](http://blog.x-aeon.com/wp-content/uploads/2013/04/ScenarioC2.png)
![](http://blog.x-aeon.com/wp-content/uploads/2013/04/ScenarioD2.png)
Here are the results data sheet for those who are interested: Benchmarks
The benchmark setup being simple (just 1 host, using dedicated queues with 1 enqueuer and 1 dequeuer each, no special performance or configuration tuning), the results
will just give us a first estimation of performance. More complex scenarios will need more complex setups to draw final thoughts.
However a few trends seem to appear:
Brokers perform much better with bigger messages. Therefore if your queuing clients can support grouping their messages, this is a win. However grouped
messages could not be spread across parallel consumers.
Persistence drawbacks (disk or db accesses) appear when brokers deal with big messages (except for QPID which is very efficient for transient messages whatever the size). This means that for small and medium messages, time
is spent on processing rather than on I/O.
ZeroMQ broker outperforms all others. This means that unless you have a need for complex broker features, ZeroMQ is a perfect message dispatcher among processes.
QPID seems to be the best at performing without persistence.
It seems AMQP protocol is much more optimized than STOMP (at least judging with RabbitMQ’s results). However this might be due to a badly coded Ruby STOMP
client, or a badly coded STOMP implementation on RabbitMQ’s side.
HornetQ seems bad at dealing with small and medium messages, compared to others.
Except for big messages, RabbitMQ seems to be the best bet as it outperforms others by a factor of 3.
Those benchmarks are part of a complete study conducted by Adina
Mihailescu, and everything was presented at the April
2013 riviera.rb meet-up. You should definitely peek into Adina’s great presentation available online right
here.
Setup and scenarios
So I wanted to benchmark brokers, using different protocols: I decided to build a little Rails application piloting a binary that was able to enqueue/dequeueitems taken from a MySQL database.
![](http://blog.x-aeon.com/wp-content/uploads/2013/04/Setup.png)
I considered the following scenarios:
Scenario A: Enqueuing 20,000 messages of 1024 bytes
each, then dequeuing them afterwards.
Scenario B: Enqueuing and dequeuing simultaneously 20,000 messages
of1024 bytes each.
Scenario C: Enqueuing and dequeuing simultaneously 200,000 messages
of32 bytes each.
Scenario D: Enqueuing and dequeuing simultaneously 200 messages
of32768 bytes each.
For each scenario, 1 process is dedicated to enqueuing, and another one is dedicated to dequeuing.
I measured the time spent by each enqueuing and dequeuing process, with 2 different broker configurations:
Using persistent queues and messages (when the broker is down and back up, queues are still containing items).
Using transient queues and messages (no persistence: when broker is down, queues and items are lost).
I decided to bench the following brokers:
ActiveMQ
5.8.0 with STOMP protocol
RabbitMQ
3.0.2 with STOMP and AMQP protocols
HornetQ
2.3.0 with STOMP protocol
Apollo
1.6 with STOMP protocol
QPID
0.20 (Java broker) with AMQP protocol
A home-made ZeroMQ
2.2.0 broker, working in memory only (no persistence).
The tests were run on a single laptop with this configuration:
Model: Dell Studio 1749
CPU: Intel Core i3 @ 2.40 GHz
RAM: 4 Gb
OS: Windows 7 64 bits
Ruby 1.9.3p392
Java 1.7.0_17-b02
Ruby AMQP client gem: amqp 0.9.10
Ruby STOMP client gem: stomp 1.2.8
Ruby ZeroMQ gem: ffi-rzmq 1.0.0
Apart from declaring the testing queues in some brokers’ configuration and the persistence settings, all brokers were running with their default configurationout
of the box (no tuning made).
You can find all the source code used to perform those benchmarks here
on github.
Results
And now, the results (processing time measured in seconds: the lower the better).
Scenario A
![](http://blog.x-aeon.com/wp-content/uploads/2013/04/ScenarioA.png)
Scenario B
![](http://blog.x-aeon.com/wp-content/uploads/2013/04/ScenarioB2.png)
Scenario C
![](http://blog.x-aeon.com/wp-content/uploads/2013/04/ScenarioC2.png)
Scenario D
![](http://blog.x-aeon.com/wp-content/uploads/2013/04/ScenarioD2.png)
Here are the results data sheet for those who are interested: Benchmarks
What can we say about it?
The benchmark setup being simple (just 1 host, using dedicated queues with 1 enqueuer and 1 dequeuer each, no special performance or configuration tuning), the resultswill just give us a first estimation of performance. More complex scenarios will need more complex setups to draw final thoughts.
However a few trends seem to appear:
Brokers perform much better with bigger messages. Therefore if your queuing clients can support grouping their messages, this is a win. However grouped
messages could not be spread across parallel consumers.
Persistence drawbacks (disk or db accesses) appear when brokers deal with big messages (except for QPID which is very efficient for transient messages whatever the size). This means that for small and medium messages, time
is spent on processing rather than on I/O.
ZeroMQ broker outperforms all others. This means that unless you have a need for complex broker features, ZeroMQ is a perfect message dispatcher among processes.
QPID seems to be the best at performing without persistence.
It seems AMQP protocol is much more optimized than STOMP (at least judging with RabbitMQ’s results). However this might be due to a badly coded Ruby STOMP
client, or a badly coded STOMP implementation on RabbitMQ’s side.
HornetQ seems bad at dealing with small and medium messages, compared to others.
Except for big messages, RabbitMQ seems to be the best bet as it outperforms others by a factor of 3.
相关文章推荐
- java 并发编程 AbstractQueuedSynchronizer 加锁和解锁分析
- UITableView的简单介绍和功能
- Null value was assigned to a property of primitive type setter of"原因及解决方
- powerbuilder开发的程序,查询功能中,listview中的属性列重复出现
- 为jenkins的每个build设置description
- Android含文档server结束(client UI接口异步请求的一部分)三
- 【EasyUI学习-2】Easyui Tree的异步加载
- 报错:ImportError: No module named 'requests'
- MUI实战开发第四集--如何增加自定义icon图标
- 关于使用unigui、webxone、mysql的几个问题
- java.sql.SQLException: Can not issue data manipulation statements with executeQuery().
- UIPanGestureRecognizer手势影响UISlider拖动的问题及解决办法
- java.sql.SQLException: Can not issue data manipulation statements with executeQuery().
- MUI仿今日头条第三集--侧滑菜单制作
- java.sql.SQLException: Can not issue empty query.
- java.sql.SQLException: Can not issue empty query.
- 跳出手掌心--如何立即触发UIButton边界事件
- 帮学长的jfinal+easyui
- “XXX.Index”不扩展类“System.Web.UI.Page”,因此此处不允许的问题
- “XXX.Index”不扩展类“System.Web.UI.Page”,因此此处不允许的问题