1 2 Previous Next 23 Replies Latest reply on Aug 30, 2012 2:45 AM by raymanf

    Tuning/Optimization HornetQ

    raymanf

      Hi,

       

      I am using Spring3.1 in standalone env.

       

      I have intergrated into it HornetQ ver 2.2.14

       

      I have read the tuninng section in the manual and I am also aware to this note:

       

      Some popular libraries such as the Spring JMS Template are known to use these anti-patterns. If you're using Spring JMS Template and you're getting poor performance you know why. Don't blame HornetQ! The Spring JMS Template can only safely be used in an app server which caches JMS sessions (e.g. using JCA), and only then for sending messages. It cannot be safely be used for synchronously consuming messages, even in an app server.

       

       

      Now here is the thing.

       

      I am using simaple scenario dispatching a message via topic having two MDB's listening to it.

      The message is kind of ObjectMessage and in the MDB's side i am using instance of in order to make sure I am expecting the right Object message.

       

      Now when I test latency in Eclipse(windows) env it's 0.

       

      I am testing the latency before the dispatch and after using System.currentTimeMillis().

       

      but when I tested my application after deploying it into linux env the latency can reach to 5,6 miliseconds.

       

      how that could be?

       

      I am running the jvm in the linux env with those params

       

      -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:SurvivorRatio=16 -XX:-PrintGCDetails -XX:-PrintGCTimeStamps -XX:+AggressiveOpts -XX:+UseFastAccessorMethods \

       

       

      any suggestations to check out?

       

      thanks.

        • 1. Re: Tuning/Optimization HornetQ
          clebert.suconic

          You're probably using the same classLoader on Eclipse.. while on the application server you will have to load the message again.

           

           

          You have to measure those things after a warm up time, i.e. after ClassLoaders are solved.. etc.

          • 2. Re: Tuning/Optimization HornetQ
            raymanf

            Hi,

            I have measure those things after warm up and still latency difrreneces are pretty higher.

            • 3. Re: Tuning/Optimization HornetQ
              ataylor

              Hi,

              I have measure those things after warm up and still latency difrreneces are pretty higher.

              firstly what do you mean by latency, from where to where, secondly you can't gaurantee System.currentTimeMillis is correct.

               

              Also what do you mean by warming up, here we are talking about a few thousand messages throughput first, and also how are you calculating the latencey, you cant do it on a single message, you will need to send at least in the thousands and calculat it that way.

              • 4. Re: Tuning/Optimization HornetQ
                raymanf

                When I speak about latency I speak about speed.

                 

                I measure point 1 before I publish a message

                I measure point 2 in the MDBS after getting the message

                 

                I am using System.currentTimeMillis.

                and in windows env(my eclipse) the difference is 0

                but in linux(using daemon ) it's about 3,4 MS.

                 

                I am warming it up with a machine which sending messages. you right I didnt warm it up by sending few thousand messages.

                 

                1. you think Ill see the diffrence after I warm up with few thousand messages?

                2. how come in windows env the latency diffrence is 0 without any warm up?

                 

                thanks.

                • 5. Re: Tuning/Optimization HornetQ
                  ataylor

                  When I speak about latency I speak about speed.

                  Measuring throughput speed and latency aren't the same thing, latency is the Round Trip time of sending a packet, so in this scenraio it would be to measure how long it takes to send a message and receive an ack from the server or for the server to send an message to a consumer and receive an ack back, messaguing is point to point and asynchronous so basically what you are measuring is throuput speed.

                  I am using System.currentTimeMillis.

                  and in windows env(my eclipse) the difference is 0

                  but in linux(using daemon ) it's about 3,4 MS.

                   

                  I am warming it up with a machine which sending messages. you right I didnt warm it up by sending few thousand messages.

                   

                  1. you think Ill see the diffrence after I warm up with few thousand messages?

                  2. how come in windows env the latency diffrence is 0 without any warm up?

                  firstly i doubt the throughput is 0, like i said send 10000 messages and divide the time by 10000 to get a more accurate timing.

                   

                  If you are sending non persistent messages all you are basically measuring is the speed of your network, if they are persitant then you are measuring your disc speed on top of this. If there are differences it will be because of this.

                   

                  A test that uses 1 producer and 2 clients isnt really a useful measure, when testing messaging performance its really about horizontal and vertical scaling, take a look at http://planet.jboss.org/post/8_2_million_messages_second_with_specjms

                  • 6. Re: Tuning/Optimization HornetQ
                    raymanf

                     

                    If you are sending non persistent messages all you are basically measuring is the speed of your network, if they are persitant then you are measuring your disc speed on top of this. If there are differences it will be because of this.

                     

                     

                    The topic and the mdb which I am measuring are local. So how the network is a factor here?

                     

                    The scenario is this: I am getting a message from a remote topic then dispatching it locally to another topic and local MDB is receiving the message.

                     

                    measure point 1 - before I send the message to the local topic.

                    measure point 2 - when the local mdb getting the message from the local topic.

                    • 7. Re: Tuning/Optimization HornetQ
                      ataylor

                      The topic and the mdb which I am measuring are local. So how the network is a factor here?

                      How was i meant to know that, you never mentioned it, anyhow, it still gets copied through an invm transport so everything else holds.

                      • 8. Re: Tuning/Optimization HornetQ
                        raymanf

                        Andy Taylor wrote:

                         

                        The topic and the mdb which I am measuring are local. So how the network is a factor here?

                        How was i meant to know that, you never mentioned it, anyhow, it still gets copied through an invm transport so everything else holds.

                        You right. my bad.

                         

                        So what you suggest me to look out for? why I have those crazy latency diffrences ?

                        • 9. Re: Tuning/Optimization HornetQ
                          ataylor

                          its not latency its throughput, and have you sent thousands of messages like i suggested

                          • 10. Re: Tuning/Optimization HornetQ
                            raymanf

                            Yes,

                            I have sent thousands of messages and you were you it got a little better..but a little..

                             

                            still in the windows machine it has 0ms latency and in the linux it's 2ms

                             

                            I followed the tuning section in the User Manual. still coudlnt get it any better.

                             

                             

                            thats my run arguments:

                            -XX:+UseConcMarkSweepGC -XX:SurvivorRatio=16 -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -XX:+UseParNewGC -Xmx2048m -Xms1024m -XX:ParallelGCThreads=4 \

                            • 11. Re: Tuning/Optimization HornetQ
                              ataylor

                              How are you calculating your latency, it cant be 0 if you are sending lots of messages. Also this may just be because its a slower machine

                              • 12. Re: Tuning/Optimization HornetQ
                                raymanf

                                I have changed it to a linux machine on dual quad.

                                 

                                I am calculating it simply using System.currentTimeMillis before dispatching to the topic.

                                then setting this value in the transfer object (to calculate the diffrence in the mdb)

                                 

                                in the mdb i am doing again System.currentTimeMillis minus the time which I entered to the object right before dispatch.

                                • 13. Re: Tuning/Optimization HornetQ
                                  ataylor

                                  that wont give you an accurate measurement, depending on the JDK, threading model it could give you anything, do this:

                                   

                                  1) send 10000 messages to warm up

                                  2) get current time in millis call this start

                                  3) send 100000 messages

                                  4) when the last message is consumed get the current time in millis call this end

                                   

                                  time per message = (end - start)/100000

                                   

                                  or

                                   

                                  messages per sec = 100000/((end-start)/1000)

                                   

                                  you get my drift

                                  • 14. Re: Tuning/Optimization HornetQ
                                    raymanf

                                    Andy Taylor wrote:

                                     

                                    that wont give you an accurate measurement, depending on the JDK, threading model it could give you anything, do this:

                                     

                                     

                                    Sorry but I am trying to get this farther.

                                     

                                    Could you give farther explaination why this is not accurate measurement?(I am using the same JDK and the measurment is tottaly on the same local maching from the starting measure point to the end measure point) 

                                     

                                    I thought the threading model on linux is better then in windows:)

                                    1 2 Previous Next