RabbitMQ – RabbitMQ on MacBook & Simple Benchmarking

1. Installation Steps

Environment

  • Operating System: macOS Sierra
  • Processor: 4 GHz Intel Core i7
  • Memory: 32 GB 1600 MHz DDR3
  • Storage: 256 GB SSD

Prerequisite Tools

Install RabbitMQ through Homebrew

$ brew install rabbitmq
==> Downloading https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.6
/rabbitmq-server-generic-unix-3.6.6.tar.xz
######################################################################## 100.0%
==> /usr/bin/unzip -qq -j /usr/local/Cellar/rabbitmq/3.6.6/plugins/rabbitmq_management-3.6.6
.ez rabbitmq_management-3.6.6/priv/www/cli/rabbitmq
==> Caveats
Management Plugin enabled by default at http://localhost:15672

Bash completion has been installed to:
 /usr/local/etc/bash_completion.d

To have launchd start rabbitmq now and restart at login:
 brew services start rabbitmq
Or, if you don't want/need a background service you can just run:
 rabbitmq-server
==> Summary
🍺 /usr/local/Cellar/rabbitmq/3.6.6: 188 files, 5.8M, built in 1 second

Start RabbitMQ

$ brew services start rabbitmq
==> Successfully started `rabbitmq` (label: homebrew.mxcl.rabbitmq)

Webpage: http://localhost:15672/
User: guest
Password: guest

2. Simple Benchmarking

Install RabbitMQ Performance Testing Tool

The performance tool distribution contains Java programs to run various performance scenarios and some HTML utility to display graphs of the performance runs.

Website: https://www.rabbitmq.com/java-tools.html

$ bin/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)

Performance Test

Send transient messages without acknowledgment, 1 producer, and 1 consumer.

$ bin/runjava com.rabbitmq.perf.PerfTest -a
id: test-185258-419, starting consumer #0
id: test-185258-419, starting consumer #0, channel #0
id: test-185258-419, starting producer #0
id: test-185258-419, starting producer #0, channel #0
id: test-185258-419, time: 1.000s, sent: 40035 msg/s, received: 30498 msg/s, min/avg/max latency: 1501/147963/241166 microseconds
id: test-185258-419, time: 2.000s, sent: 52243 msg/s, received: 51461 msg/s, min/avg/max latency: 99887/170279/247223 microseconds
id: test-185258-419, time: 3.000s, sent: 54008 msg/s, received: 49843 msg/s, min/avg/max latency: 185389/245946/308791 microseconds
id: test-185258-419, time: 4.000s, sent: 51099 msg/s, received: 53299 msg/s, min/avg/max latency: 186838/236889/297901 microseconds
id: test-185258-419, time: 5.000s, sent: 54008 msg/s, received: 53092 msg/s, min/avg/max latency: 182706/231658/299246 microseconds
id: test-185258-419, time: 6.000s, sent: 56596 msg/s, received: 55113 msg/s, min/avg/max latency: 180160/229381/294154 microseconds
id: test-185258-419, time: 7.000s, sent: 51099 msg/s, received: 53511 msg/s, min/avg/max latency: 178943/227398/276981 microseconds
id: test-185258-419, time: 8.000s, sent: 54008 msg/s, received: 54458 msg/s, min/avg/max latency: 182408/232127/300584 microseconds
...

Send transient messages with acknowledgments and confirms.

$ bin/runjava com.rabbitmq.perf.PerfTest -c 1000
id: test-190540-483, starting consumer #0
id: test-190540-483, starting consumer #0, channel #0
id: test-190540-483, starting producer #0
id: test-190540-483, starting producer #0, channel #0
id: test-190540-483, time: 1.000s, sent: 17883 msg/s, confirmed: 16884 msg/s, nacked: 0 msg/s, received: 16883 msg/s, min/avg/max latency: 795/46750/86681 microseconds
id: test-190540-483, time: 2.000s, sent: 24395 msg/s, confirmed: 24394 msg/s, nacked: 0 msg/s, received: 24396 msg/s, min/avg/max latency: 37289/40910/45079 microseconds
id: test-190540-483, time: 3.000s, sent: 22715 msg/s, confirmed: 22715 msg/s, nacked: 0 msg/s, received: 22714 msg/s, min/avg/max latency: 40336/43959/49799 microseconds
id: test-190540-483, time: 4.000s, sent: 23016 msg/s, confirmed: 23017 msg/s, nacked: 0 msg/s, received: 23017 msg/s, min/avg/max latency: 38985/43486/48558 microseconds
id: test-190540-483, time: 5.000s, sent: 22687 msg/s, confirmed: 22686 msg/s, nacked: 0 msg/s, received: 22685 msg/s, min/avg/max latency: 39670/43999/50211 microseconds
id: test-190540-483, time: 6.000s, sent: 23209 msg/s, confirmed: 23210 msg/s, nacked: 0 msg/s, received: 23212 msg/s, min/avg/max latency: 39523/43061/50755 microseconds
id: test-190540-483, time: 7.000s, sent: 23252 msg/s, confirmed: 23254 msg/s, nacked: 0 msg/s, received: 23251 msg/s, min/avg/max latency: 38910/43149/49388 microseconds
id: test-190540-483, time: 8.000s, sent: 23469 msg/s, confirmed: 23469 msg/s, nacked: 0 msg/s, received: 23468 msg/s, min/avg/max latency: 35730/42467/48994 microseconds
...
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s