Benchmark MSMQ Performance

I documented my experience using the MQBench.exe utility to measure MSMQ (Microsoft Message Queuing) performance. I encountered issues with the original KB article examples and had to consult MSMQ format name documentation to correct the queue location syntax.

Command Example

MSMQBench.exe -sr 100000 2048 -t 6 -q .\PRIVATE$\msmqbench

This sends 100,000 messages of 2KB across 6 threads (600,000 total messages).

Performance Results

  • Express mode (-sr): ~59,000 messages/second, 10.2 second test duration
  • Recoverable mode (-se): ~14,500 messages/second, 41.2 second test duration

Notable Observations

I suspected the -s option parameters for express and recoverable modes were reversed, as recoverable messaging performed at approximately one-quarter the speed of express messaging.

I also encountered errors when testing non-transactional queues, requiring MSMQ service restarts.

Important requirement: The transactional queue must exist beforehand; the tool will not create it automatically.