You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by lzr <js...@163.com> on 2011/11/30 01:12:46 UTC

Why the transaction down the performance so much???

Dear all,


By my test, the performance down greatly than the test case without the transaction.
For same program:
Without transaction in Session, 1000 tps;
With transaction in Session, about 10~20 tps which is absolutely my expectation!!!!
I attached my source files and configuration files. It's much appreciated if any suggestion.


Thanks a lot!

Re: Why the transaction down the performance so much???

Posted by Torsten Mielke <to...@fusesource.com>.
Hi, 

I have recently run some simple performance tests when consuming msgs within a local JMS transaction (committing after every msgs) and without transaction. 
There surely was a difference in performance but it was rather small. Unfortunately I don't have any numbers at hand right now but it was fairly in line with this comment from http://activemq.apache.org/should-i-use-transactions.html
 
"Incidentally, its a common misconception that transactions are slow; there's no real difference between a JMS transaction and a Message.acknowledge() from an architectural perspective in ActiveMQ;"

Btw, the maven-activemq-perf-plugin can also be used to test the speed of transacted consumers/producers
http://activemq.apache.org/activemq-performance-module-users-manual.html



Torsten Mielke
torsten@fusesource.com
tmielke@blogspot.com


On Dec 1, 2011, at 1:40 AM, lzr wrote:

> According to my comprehension of the JMS Spec, without transaction and AUTO_ACKNOWLEDGE in session the disk sync should occur once a meesage is get by the consumer; it's just like the case each message has a transaction committing?
> In this case the performance of the two cases should be similar, right?
> 
> 
> At 2011-12-01 01:12:48,"Gary Tully" <ga...@gmail.com> wrote:
>> For producers, only use transactions is you are sending more than one
>> message, so for batching. Jms already guarantees a disk sync when a
>> send returns.
>> 
>> For clients do what you wish.
>> 
>> Do try and cache connections/sessions/prodcuers
>> and if you have a single consumer cache that.
>> 
>> Remeber, transactions mean disk syncs, so you will always be limited
>> by the speed of a fsync to your disk.
>> 
>> 2011/11/30 lzr <js...@163.com>:
>>> Dear all,
>>> 
>>> By my test, the performance down greatly than the test case without the
>>> transaction.
>>> For same program:
>>> Without transaction in Session, 1000 tps;
>>> With transaction in Session, about 10~20 tps which is absolutel y my
>>> expectation!!!!
>>> I attached my source files and configuration files. It's much appreciated if
>>> any suggestion.
>>> 
>>> Thanks a lot!
>>> 
>>> 
>> 
>> 
>> 
>> -- 
>> http://fusesource.com
>> http://blog.garytully.com




Re:Re: Why the transaction down the performance so much???

Posted by lzr <js...@163.com>.
According to my comprehension of the JMS Spec, without transaction and AUTO_ACKNOWLEDGE in session the disk sync should occur once a meesage is get by the consumer; it's just like the case each message has a transaction committing?
In this case the performance of the two cases should be similar, right?


At 2011-12-01 01:12:48,"Gary Tully" <ga...@gmail.com> wrote:
>For producers, only use transactions is you are sending more than one
>message, so for batching. Jms already guarantees a disk sync when a
>send returns.
>
>For clients do what you wish.
>
>Do try and cache connections/sessions/prodcuers
>and if you have a single consumer cache that.
>
>Remeber, transactions mean disk syncs, so you will always be limited
>by the speed of a fsync to your disk.
>
>2011/11/30 lzr <js...@163.com>:
>> Dear all,
>>
>> By my test, the performance down greatly than the test case without the
>> transaction.
>> For same program:
>> Without transaction in Session, 1000 tps;
>> With transaction in Session, about 10~20 tps which is absolutel y my
>> expectation!!!!
>> I attached my source files and configuration files. It's much appreciated if
>> any suggestion.
>>
>> Thanks a lot!
>>
>>
>
>
>
>-- 
>http://fusesource.com
>http://blog.garytully.com

Re: Why the transaction down the performance so much???

Posted by Gary Tully <ga...@gmail.com>.
For producers, only use transactions is you are sending more than one
message, so for batching. Jms already guarantees a disk sync when a
send returns.

For clients do what you wish.

Do try and cache connections/sessions/prodcuers
and if you have a single consumer cache that.

Remeber, transactions mean disk syncs, so you will always be limited
by the speed of a fsync to your disk.

2011/11/30 lzr <js...@163.com>:
> Dear all,
>
> By my test, the performance down greatly than the test case without the
> transaction.
> For same program:
> Without transaction in Session, 1000 tps;
> With transaction in Session, about 10~20 tps which is absolutel y my
> expectation!!!!
> I attached my source files and configuration files. It's much appreciated if
> any suggestion.
>
> Thanks a lot!
>
>



-- 
http://fusesource.com
http://blog.garytully.com