This page documents some Java-based utility programs (performance, tracing).
The performance tool distribution contains Java programs to run various performance scenarios and some HTML utility to display graphs of the performance runs.
The distribution contains a script (runjava or runjava.bat) to run Java with the class path correctly configured, e.g. runjava com.rabbitmq.perf.PerfTest runs the PerfTest Java class.
PerfTest is a performance testing tool. It starts up zero or more producers and consumers and reports the rate at which messages are sent and received, along with the latency (i.e. time taken for messages to pass through the broker).
PerfTest supports many command line flags. Invoke it with --help to see them:
runjava com.rabbitmq.perf.PerfTest --help
runjava com.rabbitmq.perf.PerfTest -a
runjava com.rabbitmq.perf.PerfTest -c 1000
runjava com.rabbitmq.perf.PerfTest -c 1000 -f persistent
runjava com.rabbitmq.perf.PerfTest -y0 -p -u my-queue -s 1000 -C 1000000
runjava com.rabbitmq.perf.PerfTest -x0 -y10 -p -u another-queue
If a queue name is defined (-u "queue-name"), PerfTest will create a queue with this name and all consumers will consume from this queue. The queue will be bound to the direct exchange with its name as the routing key. The routing key will be used by producers to send messages. This will cause messages from all producers to be sent to this single queue and all consumers to receive messages from this single queue.
If the queue name is not defined, PerfTest will create a random UUID routing key with which producers will publish messages. Each consumer will create its own anonymous queue and bind it to the direct exchange with this routing key. This will cause each message from all producers to be replicated to multiple queues (number of queues equals number of consumers), while each consumer will be receiving messages from only one queue. When using PerfTest without a queue name it makes sense to set ratesMode for consumer to producerRatesMode * producersCount For example:
runjava com.rabbitmq.perf.PerfTest -x100 -y100 -r2 -R200
The HTML Performance Tools are a set of tools that can help you run automated benchmarks by wrapping around the PerfTest benchmarking framework. You can provide benchmark specs, and the tool will take care of running the benchmark, collecting results and displaying them in an HTML page. Learn more here.
The tracer is a very basic, very simple AMQP protocol analyzer. Use it with the runtracer or runtracer.bat script:
runtracer listenPort connectHost connectPort