You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by rostom <ro...@ymail.com> on 2013/12/18 19:27:50 UTC

Very slow producer

I have recently started working with ActiveMQ (v5.9).  The performance I am
seeing with my producer is extremely slow and was wondering if someone could
shed some light on the matter. I have my broker, producer, and consumer all
running on the same machine. Furthermore, in an effort to get accurate
stats, in none of my tests have I ran the producer and consumer
simultaneously (i.e. I run the producer 1st and put a bunch of messages on
the bus, then shut down the producer and turn on the consumer).

1K messages with default settings (producerFlowControl=true,
useAsyncSend=false):
Producer: 2.5 seconds
Consumer: 0.16 seconds

My producer puts messages on the queue one at a time using a loop in Java
(calls JmsTemplate.convertAndSend).  I am aware of the prefetch
configuration setting for sending messages to the consumer, which by default
is set to 1000 (I have also tried explicitly setting it to 1000), so that
could explain some of the discrepancy here.  However, when I change the
prefetch setting to 0, which is supposed to do one message at a time, and at
least in my mind would emulate the producer's message generation speed, the
consumer slows down to ~0.56 seconds.  But this is still nowhere close to
the slow 2.5 seconds that the producer takes.

If I change my producer/broker settings so that no ack is sent to the
producer, then I can improve things significantly, but I need message
reliability so probably don't want to go down this route:

1K messages with useAsyncSend=true:
Producer: 0.2 seconds

On a related note, does anyone know if the numbers (21-22,000
messages/second)posted the  AMQ Performance Page
<http://activemq.apache.org/performance.html>   have useAsyncSend on or off?

Thanks in advance.
rostom



--
View this message in context: http://activemq.2283324.n4.nabble.com/Very-slow-producer-tp4675669.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Very slow producer

Posted by rostom <ro...@ymail.com>.
Also note that the broker configuration is untouched from what comes with the
v5.9 binary files.  Any help would be greatly appreciated.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Very-slow-producer-tp4675669p4675682.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Very slow producer

Posted by rostom <ro...@ymail.com>.
Here is the code and config I'm using. FYI, I'm using Spring 3.2.

Spring's applicationContext.xml (located in
/src/main/resources/META-INF/spring):


A simple system.properties file (located in
/src/main/resources/META-INF/spring):


The producer class (located in /src/main/java/com/foo):


The tester/main class (located in /src/main/java/com/foo):


The ExceptionListener impl




--
View this message in context: http://activemq.2283324.n4.nabble.com/Very-slow-producer-tp4675669p4675681.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Very slow producer

Posted by Christian Posta <ch...@gmail.com>.
post your producer/consumer code + broker config and i can try on my
side. i bet it's a config issue.

On Wed, Dec 18, 2013 at 11:27 AM, rostom <ro...@ymail.com> wrote:
> I have recently started working with ActiveMQ (v5.9).  The performance I am
> seeing with my producer is extremely slow and was wondering if someone could
> shed some light on the matter. I have my broker, producer, and consumer all
> running on the same machine. Furthermore, in an effort to get accurate
> stats, in none of my tests have I ran the producer and consumer
> simultaneously (i.e. I run the producer 1st and put a bunch of messages on
> the bus, then shut down the producer and turn on the consumer).
>
> 1K messages with default settings (producerFlowControl=true,
> useAsyncSend=false):
> Producer: 2.5 seconds
> Consumer: 0.16 seconds
>
> My producer puts messages on the queue one at a time using a loop in Java
> (calls JmsTemplate.convertAndSend).  I am aware of the prefetch
> configuration setting for sending messages to the consumer, which by default
> is set to 1000 (I have also tried explicitly setting it to 1000), so that
> could explain some of the discrepancy here.  However, when I change the
> prefetch setting to 0, which is supposed to do one message at a time, and at
> least in my mind would emulate the producer's message generation speed, the
> consumer slows down to ~0.56 seconds.  But this is still nowhere close to
> the slow 2.5 seconds that the producer takes.
>
> If I change my producer/broker settings so that no ack is sent to the
> producer, then I can improve things significantly, but I need message
> reliability so probably don't want to go down this route:
>
> 1K messages with useAsyncSend=true:
> Producer: 0.2 seconds
>
> On a related note, does anyone know if the numbers (21-22,000
> messages/second)posted the  AMQ Performance Page
> <http://activemq.apache.org/performance.html>   have useAsyncSend on or off?
>
> Thanks in advance.
> rostom
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Very-slow-producer-tp4675669.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
Christian Posta
http://www.christianposta.com/blog
twitter: @christianposta

Re: Very slow producer

Posted by Gary Tully <ga...@gmail.com>.
are you caching connections?
If you enable trace level logging for the broker you can see what is
going in for those 2 seconds.

On 18 December 2013 18:27, rostom <ro...@ymail.com> wrote:
> I have recently started working with ActiveMQ (v5.9).  The performance I am
> seeing with my producer is extremely slow and was wondering if someone could
> shed some light on the matter. I have my broker, producer, and consumer all
> running on the same machine. Furthermore, in an effort to get accurate
> stats, in none of my tests have I ran the producer and consumer
> simultaneously (i.e. I run the producer 1st and put a bunch of messages on
> the bus, then shut down the producer and turn on the consumer).
>
> 1K messages with default settings (producerFlowControl=true,
> useAsyncSend=false):
> Producer: 2.5 seconds
> Consumer: 0.16 seconds
>
> My producer puts messages on the queue one at a time using a loop in Java
> (calls JmsTemplate.convertAndSend).  I am aware of the prefetch
> configuration setting for sending messages to the consumer, which by default
> is set to 1000 (I have also tried explicitly setting it to 1000), so that
> could explain some of the discrepancy here.  However, when I change the
> prefetch setting to 0, which is supposed to do one message at a time, and at
> least in my mind would emulate the producer's message generation speed, the
> consumer slows down to ~0.56 seconds.  But this is still nowhere close to
> the slow 2.5 seconds that the producer takes.
>
> If I change my producer/broker settings so that no ack is sent to the
> producer, then I can improve things significantly, but I need message
> reliability so probably don't want to go down this route:
>
> 1K messages with useAsyncSend=true:
> Producer: 0.2 seconds
>
> On a related note, does anyone know if the numbers (21-22,000
> messages/second)posted the  AMQ Performance Page
> <http://activemq.apache.org/performance.html>   have useAsyncSend on or off?
>
> Thanks in advance.
> rostom
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Very-slow-producer-tp4675669.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



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