You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Danilo Tuler <tu...@ideais.com.br> on 2006/08/09 16:05:56 UTC

ActiveMQSession.createConsumer slow

Hi,

My call to ActiveMQSession.createConsumer is very slow, taking up to 2
seconds to responde.
The client and server are separated by an internet connection.
The broker is being fed by a single producer on the same machine of the
broker.

Debugging the client code I see AMQ sends a synchronous message to the
broker with the ConsumerInfo. And this is blocking the client. My
application needs to subscribe to ~50 topics, but taking more than a minute
to do that is unacceptable for me.

Is this performance normal?
Is there any tweak or test I could make?
Do you need any more info on my configuration?

My debug call stack is below.

Thank you very much.
Danilo

Thread [main] (Suspended)	
	FutureResponse.getResult() line: 38	
	ResponseCorrelator.request(Command) line: 74	
	ActiveMQConnection.syncSendPacket(Command) line: 1112	
	ActiveMQSession.syncSendPacket(Command) line: 1667	
	ActiveMQMessageConsumer.<init>(ActiveMQSession, ConsumerId,
ActiveMQDestination, String, String, int, int, boolean, boolean, boolean)
line: 196	
	ActiveMQSession.createConsumer(Destination, String) line: 840	
	ActiveMQSession.createConsumer(Destination) line: 800	

-- 
View this message in context: http://www.nabble.com/ActiveMQSession.createConsumer-slow-tf2078999.html#a5726421
Sent from the ActiveMQ - User forum at Nabble.com.


Re: ActiveMQSession.createConsumer slow

Posted by Danilo Tuler <tu...@ideais.com.br>.

> I guess we could add a useAsyncSubscribe flag to the connection.

That would be very welcome.
The MessageConsumer would still be returned, so I can set the
messageListener.

-- Danilo

-- 
View this message in context: http://www.nabble.com/ActiveMQSession.createConsumer-slow-tf2078999.html#a5733090
Sent from the ActiveMQ - User forum at Nabble.com.


Re: ActiveMQSession.createConsumer slow

Posted by Hiram Chirino <hi...@hiramchirino.com>.
I guess we could add a useAsyncSubscribe flag to the connection.  You
just have to be aware that the subscribe could fail and that it would
produce and error that you can catch using an ExceptionListener
registered with the connection.

On 8/9/06, James Strachan <ja...@gmail.com> wrote:
> On 8/9/06, Danilo Tuler <tu...@ideais.com.br> wrote:
> > Hi,
> >
> > My call to ActiveMQSession.createConsumer is very slow, taking up to 2
> > seconds to responde.
>
> That sounds like a slow internet link - or maybe the broker is overworked?
>
>
> > The client and server are separated by an internet connection.
> > The broker is being fed by a single producer on the same machine of the
> > broker.
> >
> > Debugging the client code I see AMQ sends a synchronous message to the
> > broker with the ConsumerInfo. And this is blocking the client. My
> > application needs to subscribe to ~50 topics, but taking more than a minute
> > to do that is unacceptable for me.
> >
> > Is this performance normal?
>
> No - its very slow
>
>
> > Is there any tweak or test I could make?
>
> Pretty much all request-responses with the broker are about the same
> in terms of time.
>
>
> > Do you need any more info on my configuration?
> >
> > My debug call stack is below.
>
> You could try subscribe to many destinations in one go using composite
> destinations...
>
> http://incubator.apache.org/activemq/composite-destinations.html
>
> other than that all you can do is investigate your
> network/hardware/firewall/proxies to see why request-response over
> your network is so slow
>
> --
>
> James
> -------
> http://radio.weblogs.com/0112098/
>


-- 
Regards,
Hiram

Blog: http://hiramchirino.com

Re: ActiveMQSession.createConsumer slow

Posted by Danilo Tuler <tu...@ideais.com.br>.

> What kind of hardware is this running on?

Pentium IV 2.4GHz 1GB Ram

> Is the box the broker running on starved of CPU or IO?

Low CPU activity (5%)
Low IO too.
Everything pretty normal.

> Whats the difference if a consumer on the same box as the broker does
> 100 subscribes?

I'm not able to test on the same box, but on a neighboor box (local network)
it takes 100-300 ms per topic.

> Those numbers sound very slow.

:-(
The topics are non-durable, non-persistent, with lastImageSubscriptionPolicy
on.

Thanks,
Danilo

-- 
View this message in context: http://www.nabble.com/ActiveMQSession.createConsumer-slow-tf2078999.html#a5733197
Sent from the ActiveMQ - User forum at Nabble.com.


Re: ActiveMQSession.createConsumer slow

Posted by James Strachan <ja...@gmail.com>.
What kind of hardware is this running on? Is the box the broker
running on starved of CPU or IO? Those numbers sound very slow.

Whats the difference if a consumer on the same box as the broker does
100 subscribes?

On 8/9/06, Danilo Tuler <tu...@ideais.com.br> wrote:
>
>
> > or maybe the broker is overworked?
>
> The broker is receiving ~80 messages/sec from a single producer. Not much I
> guess...
> The transport is tcp in the same machine, not vm.
>
> > Pretty much all request-responses with the broker are about the same
> > in terms of time.
>
> Is there any message priority handling on the server?
> I mean, subscription (or command) messages are handled just like ordinary
> messages?
>
> > You could try subscribe to many destinations in one go using composite
> > destinations...
>
> My application is the famous stock quotes publish/subscribe.
> The list of symbols is dynamic.
> A symbol may be removed or added to the watchlist anytime.
> When a symbol is added I could close the composite destination, and recreate
> it.
> This may be as fast as subscribing to the single symbol. But this is ugly...
>
> > other than that all you can do is investigate your
> > network/hardware/firewall/proxies to see why request-response over
> > your network is so slow
>
> In a local connection the subscription of 50 topics takes 10 seconds instead
> of 100 seconds.
> Is this time (200ms) more realistic, or is it still high?
>
> I know speaking about times like this is not accurate as its depends on a
> lot of factors.
> I'm just trying to find out if my situation falls in the "absurd" category.
>
> Thanks,
> Danilo
> --
> View this message in context: http://www.nabble.com/ActiveMQSession.createConsumer-slow-tf2078999.html#a5732723
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Re: ActiveMQSession.createConsumer slow

Posted by Danilo Tuler <tu...@ideais.com.br>.

> or maybe the broker is overworked?

The broker is receiving ~80 messages/sec from a single producer. Not much I
guess...
The transport is tcp in the same machine, not vm.

> Pretty much all request-responses with the broker are about the same
> in terms of time.

Is there any message priority handling on the server?
I mean, subscription (or command) messages are handled just like ordinary
messages?

> You could try subscribe to many destinations in one go using composite
> destinations...

My application is the famous stock quotes publish/subscribe.
The list of symbols is dynamic.
A symbol may be removed or added to the watchlist anytime.
When a symbol is added I could close the composite destination, and recreate
it.
This may be as fast as subscribing to the single symbol. But this is ugly...

> other than that all you can do is investigate your
> network/hardware/firewall/proxies to see why request-response over
> your network is so slow

In a local connection the subscription of 50 topics takes 10 seconds instead
of 100 seconds.
Is this time (200ms) more realistic, or is it still high?

I know speaking about times like this is not accurate as its depends on a
lot of factors.
I'm just trying to find out if my situation falls in the "absurd" category.

Thanks,
Danilo
-- 
View this message in context: http://www.nabble.com/ActiveMQSession.createConsumer-slow-tf2078999.html#a5732723
Sent from the ActiveMQ - User forum at Nabble.com.


Re: ActiveMQSession.createConsumer slow

Posted by James Strachan <ja...@gmail.com>.
On 8/9/06, Danilo Tuler <tu...@ideais.com.br> wrote:
> Hi,
>
> My call to ActiveMQSession.createConsumer is very slow, taking up to 2
> seconds to responde.

That sounds like a slow internet link - or maybe the broker is overworked?


> The client and server are separated by an internet connection.
> The broker is being fed by a single producer on the same machine of the
> broker.
>
> Debugging the client code I see AMQ sends a synchronous message to the
> broker with the ConsumerInfo. And this is blocking the client. My
> application needs to subscribe to ~50 topics, but taking more than a minute
> to do that is unacceptable for me.
>
> Is this performance normal?

No - its very slow


> Is there any tweak or test I could make?

Pretty much all request-responses with the broker are about the same
in terms of time.


> Do you need any more info on my configuration?
>
> My debug call stack is below.

You could try subscribe to many destinations in one go using composite
destinations...

http://incubator.apache.org/activemq/composite-destinations.html

other than that all you can do is investigate your
network/hardware/firewall/proxies to see why request-response over
your network is so slow

-- 

James
-------
http://radio.weblogs.com/0112098/