Monday, October 06, 2008

SonicMQ: Constructing New MessagePublishers or not?

Just as a quick follow-on to my previous mini-benchmark, I've now tried the same basic benchmark but testing publishing each message to its own Topic, and tested creating a new MessagePublisher per message, versus creating a unbound (Session.createProducer(null)) MessageProducer and using that to send all messages (producer.send(destination, message)).

For the lazy and link-click-shy, this is a tiny benchmark of how to publish small messages as fast as possible against SonicMQ 7.5.1 using the 7.5 JMS driver.

There is a difference, but a pretty small one.
  • Creating a single MessageProducer and using producer.send(destination, message) gave me 32352mps sent.
  • Creating a new MessageProducer for each new message/topic gave me 31847mps sent.
  • This was definitely reproducible, and I ran each test many times to make sure I got a pretty consistent result.

So there's a minor performance enhancement (1.5%), but it's pretty small, and judging from network traffic, it's not actually hitting the wire for the new MessageProducer, so it's entirely a local driver optimization.
blog comments powered by Disqus