Akka Actors on Mac beating the S#!t Out of my Dell

Posted on Friday, August 26, 2011


Let me explain the scenario. We have n (tens, hundreds or thousands) of Akka actors listening to a queue on RabbitMQ server. So the scenario looks something like this

AMQP.newConsumer(connection, ConsumerParameters("*", actor, Some(queueName), Some(exchangeParameters)))

As you would notice, each of the actors gets a message from the Q and invokes a plugin to do the processing and returns the results back to the result Q.
Now the fun happens when I execute the same code on my machine and my competitors (Meetu’s) machine.

Meetu has a Macbook pro – 2 cores – 2.3 GHz Intel core i5 – RAM 4GB – 64 bit
Mine is Dell Vostro – 4 cores – 2.4 GHz Intel core i5 – RAM 3GB – 32 bit

And here are the results

We start with 10 actors getting 100 messages and go all the way to 1,000 actors getting 10,000 messages. Everything in the code is the same except the hardware on which the tests are executed. I start of badly and see that on my machine 10 actors are processing messages in 5.298 s as compared to 3.039s on Meetu’s mac. This prompts me to skip to the other portion of the spectrum where I feel I can show him the power of my 4 cores. I am mistaken that the initial load of fewer messages and actors is actually having overhead for 4 cores and they would perform well on the other end.

Sadly with 1000 actors and 10000 messages the tiny mac with 2 cores outperforms the hulk dell with 4 cores by a margin of more than 10s.

What could be going wrong? There is no other heavy processing happening, on either machine, when we are running the tests. I doubt 64 bit vs 32 bit would cause such an upset. What else?

Posted in: Scala