qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Kennedy <andrewinternatio...@gmail.com>
Subject Re: Transaction java client performance issue
Date Tue, 05 Oct 2010 19:40:00 GMT
On 4 Oct 2010, at 14:39, Barys_Ilyushonak@troika.ru wrote:
> Folks, greetings.

Hi, Boris.

> Could you please help me to clarify the following performance issue  
> with
> transaction java qpid client (jms)
> I use org.apache.qpid.jndi.PropertiesFileInitialContextFactory to get
> messages from broker.
> I read messages in one thread in java main application
> If I use
>                         Session session = connection.createSession 
> (false, Session.AUTO_ACKNOWLEDGE);
> I got 10000 messages per seconds
>
> But if I use
>                         Session session = connection.createSession 
> (true, Session.AUTO_ACKNOWLEDGE);

Note that the second parameter is ignored if the first is set to  
"true" - it is preferable to set it to 'Session.SESSION_TRANSACTED'  
in this case, to make things clearer.

> and commit transaction after each message I got only 60 messages per
> seconds
>
> Could you please advice why is the difference is so significant?
> How can I improve performance for my installation?

Firstly, you are using persistent messages (the default) so they are  
being written to disk, and also transactions, which is the slowest  
throughput usage pattern. Secondly, you will be using the default  
prefetch setting, which is either 500 or 1000 (depending on broker  
version) which causes this amount of messages to be buffered by the  
client.

In order to increase performance, I would suggest two things - one,  
batch up your commits if possible, and two, set "maxprefetch" to this  
batch size. This can be done by adding "&maxprefetch='10'" to the end  
of the connection factory URL in your client properties file.

If you can do without persistence and transactions, then transient,  
non-acknowledged messages are fastest of all, this depends on your  
application and use cases.

> I use default journal settings on the broker. I use c++ broker, I  
> built it
> on RedHat 5.5.

I didn't notice this, sorry. The preceding is most relevant for the  
Java broker, unfortunately, and I don't know how it translates to the  
C++ version?

Andrew.
-- 
-- andrew d kennedy ? do not fold, bend, spindle, or mutilate ;
-- http://grkvlt.blogspot.com/ ? edinburgh : +44 7941 197 134 ;

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Mime
View raw message