HornetQ cluster mode performance test problem
oliverer Jun 16, 2011 10:52 PMI create five hornetq nodes using the default config of cluster mode.
The address setting :
<address-settings>
<!--default for catch all-->
<address-setting match="#">
<dead-letter-address>jms.queue.DLQ</dead-letter-address>
<expiry-address>jms.queue.ExpiryQueue</expiry-address>
<redelivery-delay>0</redelivery-delay>
<max-size-bytes>104857600</max-size-bytes>
<page-size-bytes>10485760</page-size-bytes>
<message-counter-history-day-limit>10</message-counter-history-day-limit>
<address-full-policy>BLOCK</address-full-policy>
<redistribution-delay>999</redistribution-delay>
</address-setting>
</address-settings>
The hornetq server node's JVM args is " -XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M "
And then I try to test the performence of the message send and receive.
First I create 200 queue named "queue.px" ( px is p1 p2 ... p200) bind to there same queue name in each node, so the messages will be distribute to every node by average.
I use five thread to send the message, each thread send 10 thousand messages to a random queue and then sleep 100ms , the message is nondurable.
source |
---|
while(true) { try {
sign = ""+(new Random().nextInt(200)+1); final String queueName = "jms.queue.exampleQueue.p"+sign; final int maxMsg = 10000; ClientSession session = null; ClientProducer producer = null; long t1 = System.currentTimeMillis(); try { session = sf.createSession(); ClientMessage message = session.createMessage(false); producer = session.createProducer(queueName); for (int i = 0; i < maxMsg; i++) { message.putStringProperty("myprop", "Hello sent at " + i + " : " + new Date()); producer.send(message); } } catch (Exception e) { e.printStackTrace(); } finally { if (producer != null) producer.close(); if (session != null) session.close(); } System.out.println(id+"-"+sign+" : producer send cost " + (System.currentTimeMillis() - t1) + " time"); Thread.sleep(100); } catch (Exception e) { e.printStackTrace(); } |
Five thread receive the message , each thread received the messages of the queue in order.
This is not a large stress testing ,but the hornetq server node creshed in 60 seconds.
The iostat is :
Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
xvda 4801.00 190.00 7685.00 3845.00 99888.00 32288.00 11.46 4.02 2.83 0.07 81.20
xvdb 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
xvda 4176.00 719.00 8061.00 6694.00 97896.00 59304.00 10.65 2.63 0.18 0.03 38.00
xvdb 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
The message is nondurable ( ClientMessage message = session.createMessage(false);)
What's the hornetq server doing? What's are they writing?