8 Replies Latest reply on May 20, 2008 9:50 PM by trustin

    Mixing Blocking and OneWay calls is very slow...

    clebert.suconic

      I have been struggling on identifying this:

      If you mix calls of Blocking and OneWay calls, you will have serious performance problems.

      Say.. if you send one or two messages, and call commit this would lead to this condition, which is a very common use case.


      I have isolated this scenario at org.jboss.messaging.tests.integration.core.remoting.mina.timing.MeasureRemoteTest#testMixingSends

      I'm basically doing calls on a FakeServer like:

      for (int i=0; i<NUMBER_OF_MESSAGES; i++)
       {
       if (i%2 == 0)
       {
       remoting.sendOneWay(10, 10, new EmptyPacket(EmptyPacket.CLOSE));
       }
       else
       {
       remoting.sendBlocking(10, 0, new EmptyPacket(EmptyPacket.CLOSE));
       }
       }
      


      And this is only able to send 50 messages / second. (25 onWay and 25 blockings per second).


      Another way to replicate this is running perfSender like this:

      ant -Dsess.trans=true -Dsess.trans.size=1 perfSender


      And you will get this:
      perfSender:
       [echo] ***********************************************************************************
       [echo] * available parameters (-Dmessage.count=1000)
       [echo] *
       [echo] * param description default current
       [echo] * message.count number of messages 200000 200000
       [echo] * delivery.mode PERSISTENT/NON_PERSISTENT NON_PERSISTENT NON_PERSISTENT
       [echo] * sample.period timing period in seconds 1 second 1
       [echo] * sess.trans Is session transacted false true
       [echo] * sess.trans.size batch size to commit 5000 1
       [echo] ***********************************************************************************
       [java] 20:44:52,060 INFO @main [PerfExample] Transacted:true
       [java] 20:44:52,061 INFO @main [PerfExample] params = message to send = 200000 samplePeriod = 1ms DeliveryMode = NON_PERSISTENT session transacted = true transaction batch size = 1
       [java] 20:44:53,387 INFO @pool-1-thread-1 [PerfExample] time elapsed 0 secs, message count 25 : this period 25
       [java] 20:44:54,387 INFO @pool-1-thread-1 [PerfExample] time elapsed 1 secs, message count 50 : this period 25
       [java] 20:44:55,387 INFO @pool-1-thread-1 [PerfExample] time elapsed 2 secs, message count 75 : this period 25
       [java] 20:44:56,387 INFO @pool-1-thread-1 [PerfExample] time elapsed 3 secs, message count 100 : this period 25
      
      



      BTW: this round number (50 or 25) is very intriguing. I have tried to use a profiler but the profiler I was using didn't inform the correct times. Jesper has done a lot of work on JBossProfiler 2.. so I might setup something if I can squeeze some time.