You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by boday <bo...@vektrel.com> on 2009/07/07 02:26:21 UTC

Re: fast SE producer and slow SE consumer

GNODET, can you be more specific about what SMX does on its own.  Does SMX
rebalance things in this situation.  Does it slow down the producers?  Does
is queue at the consumer indefinitely?  Does it spawn more consumer threads
automatically?

I'm seeing a similar situation in my application where a particular queue is
continuing to grow.  The system seems to be performing fine now, but
eventually that queue is going to use too many resources and crash the SMX
server...right?

If there are any good articles that discuss this, please point me to them.

thanks in advance


gnodet wrote:
> 
> You can configure the SEDA queues and thread pools.
> See http://incubator.apache.org/servicemix/thread-pools.html
> 


-----
Ben O'Day
Vektrel - Senior Consultant

-- 
View this message in context: http://www.nabble.com/fast-SE-producer-and-slow-SE-consumer-tp8791741p24365173.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: fast SE producer and slow SE consumer

Posted by boday <bo...@vektrel.com>.
thanks Dave. By increasing the "concurrentConsumers" on my queues, I'm able
to solve the slow consumer issues.  Now I'm faced with slow overall
throughput.  I monitor the queues and they are almost always empty and the
CPU load is relatively low.  

Here is my Camel route (Camel 1.6.1 on SMX 3.3.1)...

from("jetty:http://localhost:7001/deliver")
.process(new HTTPInboundService())   //needed to convert InputStream to
String
.to("activemq:GatewayMsgQueue");

from("activemq:GatewayMsgQueue?concurrentConsumers=20")
.to("activemq:processInboundMsg");

from("activemq:processInboundMsg?concurrentConsumers=20")
.convertBodyTo(DOMSource.class)
.to("jbi:service:http://localhost/eda/messageDecoder?mep=in-out")
.convertBodyTo(String.class)
.to("activemq:persistMsg");

from("activemq:persistMsg?concurrentConsumers=20")
.to("jbi:service:http://localhost/eda/messagePersister?mep=in-out")		
.convertBodyTo(String.class)
.to("activemq:publishMsg");

from("activemq:publishMsg?concurrentConsumers=20")						
.convertBodyTo(DOMSource.class) 
.multicast().to("jbi:service:http://localhost/eda/portalJMSService?mep=in",
  		     "jbi:service:http://localhost/eda/portalJMSService2?mep=in");

If I remove the JBI service calls to decode/persist the message, I'm able to
process 500+ msgs/second.  Otherwise, I'm getting closer to 40 msgs/second
with the full route in place.  I'm not sure what else I can do because the
queues to decode/persist/publish are always empty and the threads seem
mostly idle.  It seems like the throttle is just slowed on the inbound
message consumption too much for some reason (it backs up on the service
that supplies the inbound HTTP requests).

Is there some other configuration that is necessary?  I've seen reference to
the thread-pools configuration, but I'm sure how this applies exactly.

thanks again


-----
Ben O'Day
Vektrel - Senior Consultant

-- 
View this message in context: http://www.nabble.com/fast-SE-producer-and-slow-SE-consumer-tp8791741p24421396.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: fast SE producer and slow SE consumer

Posted by Dave Stanley <ds...@gmail.com>.
It depends on the SU type to some extent. If you are you using a JMS
consumer bc  and you use persistent messages, the underlying broker will
process the incoming messages up to the limits set for that JMS queue. At
that point flow control would kick in and the producer would be throttled.
Messages would be fed to downstream SU's at whatever rate they can accept
them based on the components seda queue & threadpool configuration (i.e.
tweak the queue backing the seda queue's executor or the # of threads the
components executor will use).

>> Does SMX rebalance things in this situation.
In this type of situation, assuming your processing a burst of data things
will rebalance themselves once the incoming workload slows. If the server is
pegged, you should not see resource usage continue to grow after the
components hit their full capacity to processing work.

>>The system seems to be performing fine now, but eventually that queue is
going to use too many resources and crash the SMX server...right?

If its a jms queue I would say no. The underlying broker will throttle the
flow of messages. Its worth keeping an eye on the both the servicemix and
activemq broker counters using jconsole/jmx. This will give you a good idea
how the system is reacting to increased load.

Hope this helps
/Dave


On Mon, Jul 6, 2009 at 8:26 PM, boday <bo...@vektrel.com> wrote:

>
> GNODET, can you be more specific about what SMX does on its own.  Does SMX
> rebalance things in this situation.  Does it slow down the producers?  Does
> is queue at the consumer indefinitely?  Does it spawn more consumer threads
> automatically?
>
> I'm seeing a similar situation in my application where a particular queue
> is
> continuing to grow.  The system seems to be performing fine now, but
> eventually that queue is going to use too many resources and crash the SMX
> server...right?
>
> If there are any good articles that discuss this, please point me to them.
>
> thanks in advance
>
>
> gnodet wrote:
> >
> > You can configure the SEDA queues and thread pools.
> > See http://incubator.apache.org/servicemix/thread-pools.html
> >
>
>
> -----
> Ben O'Day
> Vektrel - Senior Consultant
>
> --
> View this message in context:
> http://www.nabble.com/fast-SE-producer-and-slow-SE-consumer-tp8791741p24365173.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>