Saturday, October 13, 2007

Testing of jruby JMS vs MRI activemessaging in production mode

My previous performance tests of jruby JMS vs MRI activemessaging were flawed - I wasn't running in production mode, and my classes were being reloaded every time a message was processed. Rookie mistake. Anyway, here are my latest performance results running in production mode:

It turns out that MRI and activemessaging is faster. Not sure what causes the strange profile in the MRI test (perhaps garbage collection?), but I ran the test twice and came up with very similar profiles.

Thanks very much to my friend and colleague Joe Poon for pointing this out to me. Apologies to anyone who was inconvenienced by this.


Randito said...

Can you go over your ActiveMessaging setup again?

I understand the listeners, pollers, and other elements used in ActiveMessaging.

I'm just curious what you used for your message broker. Did you use a Stomp protocol?

(I'm kind of new to the messaging parlance, so forgive my use and misuse of the jargon).

Shane Harvie said...

The activemessaging setup can be found here

I'm using ActiveMQ as the message broker, and Stomp as the protocol. If you have any more questions, please don't hesitate to ask.

James Strachan said...

Are you comparing like for like? e.g. are you persisting each message to disk before sending the next one in both situations? Or is one a pure in-VM protocol etc?

BTW if you are using jruby with JMS - you could embed the message broker inside jruby to avoid the context switch.

Also if you use the TCP protocol it'll be a fair bit faster than stomp

Joshua Graham said...

G'day Shane,

While you're at looking at "production" mode on MRI take a look at your JVM config too. Check things like Server mode, assertions disabled, heap size, etc are reasonable.

Also, try JRuby on compiled scripts(now that all nodes compile) see what the differences are - it's worth playing around.

Shane Harvie said...

Thanks guys. I also had some recommendations from Alexey Verkhovsky that I try the latest trunk of JRuby (I was using 1.0), that I let the JVM 'warm up' with a few thousand messages so that the just-in-time compiler kicks in, and that I turn off ObjectSpace. It seems I have a ways to go before I get an accurate performance result. I probably won't get around to it for some time, but at least the info is here for anyone else that wants to try.