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/24 18:57:35 UTC

Camel throughput issues...HTTP to AMQ

I'm using SMX 3.3.1 and Camel 1.6.1.  I have the following Camel route which
simply takes inbound HTTP posts and sends them to an AMQ queue.  I was
getting pretty good throughput (400+/sec) until I added the 3rd line to
process the inbound data (seemed necessary to populate the AMQ message body
correctly...not sure why though).  Now my throughput is cut to ~150/second.  

Any ideas why that would be?  I can't imagine the overhead of the processor
is that much...but apparently this setup is causing some issues.

	from("jetty:http://www.test.com")
	.inOnly()                                           //is this necessary?
	.process(new HTTPInboundService())     //slows things down considerable
	.to("activemq:GatewayMsgQueue");

  class HTTPInboundService implements Processor {
        public void process(Exchange exchange) throws Exception {
        	try {
        		exchange.getOut().setBody(exchange.getIn().getBody(String.class));
        	} catch (Exception e) {
        		logger.error("HTTPInboundService.error->" + e.getMessage());
        		throw e;
        	}
        }
    }    

Along these lines, is there a better way to get high volume (400+ msg/sec)
HTTP data into an AMQ queue (for downstream processing)?  I tried adding a
seda queue in between the two...but the seda queue just filled up and
errored out after a few minutes.  Its like AMQ can't keep up with the
traffic...does this sound right?

	        from("jetty:http://www.test.com")
		.inOnly()
		.to("seda:inbound?size=20000");
		
		from("seda:inbound?size=20000")
		.thread(100)
		.process(new HTTPInboundService())
		.to("activemq:GatewayMsgQueue");

thanks


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

-- 
View this message in context: http://www.nabble.com/Camel-throughput-issues...HTTP-to-AMQ-tp24648117p24648117.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Camel throughput issues...HTTP to AMQ

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

In relation to why the POJO version is faster than the Camel route is
that the POJO is all done in a single bean.
When you route with Camel it adds additional processing in between for
cross cutting concerns such as
- error handling
- stream cache
- jmx instrumentation
- copying messages changes from one node to the next

All together it cost performance.

In Camel 2.0 we have paved the road to allow us to do speed
optimizations under the cover without affecting the end user and
being able to get on pair speed with Camel routing vs. more direct
usage such as the POJO model.

We have not yet focused too much on performance in Camel 1.x. This is
a goal with the 2.x version to optimize speed and memory usage etc.

The FUSE field team is excellent in getting great speed with AMQ, SMX
and Camel together.
I know they can get more than 1000 msg/sec with Camel in SMX between
AMQ so its possible, on a regular PC.
And that is on Camel 1.x

We have a wiki page with ideas for speed optimizations in Camel 2.x
http://camel.apache.org/camel-2x-speed-optimizations.html



On Tue, Jul 28, 2009 at 6:39 PM, boday<bo...@vektrel.com> wrote:
>
> I have tried setting maxMessagesPerTask=-1, concurrentConsumers=20,
> maxConcurrentConsumers=20, but I'm still not getting any better throughput.
> Any other ideas?
>
> Also, I can't find Camel 1.6.2 anywhere in the Maven repositories, it
> doesn't appear to have been released yet.  Also, any updates on when Camel
> 2.0 will be available for use with SMX 3.3?  I've read about many
> performance improvements that I'd like to be able to take advantage of.
>
> thanks again...
>
>
>
> -----
> Ben - Senior Consultant
>
> --
> View this message in context: http://www.nabble.com/Camel-throughput-issues...HTTP-to-AMQ-tp24648117p24703317.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Camel throughput issues...HTTP to AMQ

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Sep 2, 2009 at 2:29 AM, boday<bo...@vektrel.com> wrote:
>
> Claus, what is the latest ETA on FUSE ESB 4.2/Camel 2 release?

As to my understanding FUSE ESB 4.2 with FUSE EIP 2.0 is scheduled for
Q3 2009, where september is the current target.

>
> thanks
>
>
> Claus Ibsen-2 wrote:
>>
>> On Tue, Jul 28, 2009 at 8:56 PM, boday<bo...@vektrel.com> wrote:
>>>
>>> Thanks for the information.  This definitely makes me hesitant to
>>> continue
>>> using Camel 1.6.X with SMX 3.X.  It sounds like there are various
>>> performance issues that likely won't be resolved until I move to 2.X and
>>> SMX
>>> 4 (neither of which is released yet).  Any ETA on when both SMX 4 and
>>> Camel
>>> 2.0 will be production ready?
>>>
>> In september 2009 FUSE ESB 4.2 is planned to be released that is based
>> on SMX 4 and Camel 2.
>>
>>
>>> I guess I'm back to using servicemix-eip, servicemix-jms and
>>> servicemix-http
>>> components (painful in comparison to the Camel implementation).
>>>
>>> From a performance perspective.  I am seeing decent numbers routing from
>>> HTTP to AMQ now (500+/sec), but as soon as I route through in either a
>>> process() method or a JBI service, the throughput drops significantly
>>> (~100/sec).  I'm going to rework my application to not use Camel at all
>>> to
>>> see where I end up.
>>
>> You should disable error handling and JMX (might not give as much) to
>> get better performance.
>>
>> In the Java DSL
>> errorHandler(noErrorHandler);
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>>
>
>
> -----
> Ben - Senior Consultant
>
> --
> View this message in context: http://www.nabble.com/Camel-throughput-issues...HTTP-to-AMQ-tp24648117p25249715.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Camel throughput issues...HTTP to AMQ

Posted by boday <bo...@vektrel.com>.
Claus, what is the latest ETA on FUSE ESB 4.2/Camel 2 release?  

thanks


Claus Ibsen-2 wrote:
> 
> On Tue, Jul 28, 2009 at 8:56 PM, boday<bo...@vektrel.com> wrote:
>>
>> Thanks for the information.  This definitely makes me hesitant to
>> continue
>> using Camel 1.6.X with SMX 3.X.  It sounds like there are various
>> performance issues that likely won't be resolved until I move to 2.X and
>> SMX
>> 4 (neither of which is released yet).  Any ETA on when both SMX 4 and
>> Camel
>> 2.0 will be production ready?
>>
> In september 2009 FUSE ESB 4.2 is planned to be released that is based
> on SMX 4 and Camel 2.
> 
> 
>> I guess I'm back to using servicemix-eip, servicemix-jms and
>> servicemix-http
>> components (painful in comparison to the Camel implementation).
>>
>> From a performance perspective.  I am seeing decent numbers routing from
>> HTTP to AMQ now (500+/sec), but as soon as I route through in either a
>> process() method or a JBI service, the throughput drops significantly
>> (~100/sec).  I'm going to rework my application to not use Camel at all
>> to
>> see where I end up.
> 
> You should disable error handling and JMX (might not give as much) to
> get better performance.
> 
> In the Java DSL
> errorHandler(noErrorHandler);
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 


-----
Ben - Senior Consultant

-- 
View this message in context: http://www.nabble.com/Camel-throughput-issues...HTTP-to-AMQ-tp24648117p25249715.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Camel throughput issues...HTTP to AMQ

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Jul 28, 2009 at 8:56 PM, boday<bo...@vektrel.com> wrote:
>
> Thanks for the information.  This definitely makes me hesitant to continue
> using Camel 1.6.X with SMX 3.X.  It sounds like there are various
> performance issues that likely won't be resolved until I move to 2.X and SMX
> 4 (neither of which is released yet).  Any ETA on when both SMX 4 and Camel
> 2.0 will be production ready?
>
In september 2009 FUSE ESB 4.2 is planned to be released that is based
on SMX 4 and Camel 2.


> I guess I'm back to using servicemix-eip, servicemix-jms and servicemix-http
> components (painful in comparison to the Camel implementation).
>
> From a performance perspective.  I am seeing decent numbers routing from
> HTTP to AMQ now (500+/sec), but as soon as I route through in either a
> process() method or a JBI service, the throughput drops significantly
> (~100/sec).  I'm going to rework my application to not use Camel at all to
> see where I end up.

You should disable error handling and JMX (might not give as much) to
get better performance.

In the Java DSL
errorHandler(noErrorHandler);



>
> Anyone else have any comments on this?  Are others seeing better performance
> using these components?
>
> thanks...
>
>
>
>
> -----
> Ben - Senior Consultant
>
> --
> View this message in context: http://www.nabble.com/Camel-throughput-issues...HTTP-to-AMQ-tp24648117p24705812.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Camel throughput issues...HTTP to AMQ

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Jul 28, 2009 at 8:56 PM, boday<bo...@vektrel.com> wrote:
>
> Thanks for the information.  This definitely makes me hesitant to continue
> using Camel 1.6.X with SMX 3.X.  It sounds like there are various
> performance issues that likely won't be resolved until I move to 2.X and SMX
> 4 (neither of which is released yet).  Any ETA on when both SMX 4 and Camel
> 2.0 will be production ready?
>
> I guess I'm back to using servicemix-eip, servicemix-jms and servicemix-http
> components (painful in comparison to the Camel implementation).
>
> From a performance perspective.  I am seeing decent numbers routing from
> HTTP to AMQ now (500+/sec), but as soon as I route through in either a
> process() method or a JBI service, the throughput drops significantly
> (~100/sec).  I'm going to rework my application to not use Camel at all to
> see where I end up.

The internal modifications and architecture changes for Camel 2.0
allows us to do massive speed optimizations in Camel routing engine.
That should get you back to the 500+/sec when you using the route (as
you get only now if doing all work in a single bean class).

In Camel 1.x it does a fair amount of work under the covers to ensure
messages are transported safely from one node to the next in the
route.
By doing this more intelligently in Camel 2.x we can gain much performance.

Notice the performance hit is only when you do the "go as fast as you
can". If you just route a low/medium sized amount of messages then the
overhead is low.



>
> Anyone else have any comments on this?  Are others seeing better performance
> using these components?
>
> thanks...
>
>
>
>
> -----
> Ben - Senior Consultant
>
> --
> View this message in context: http://www.nabble.com/Camel-throughput-issues...HTTP-to-AMQ-tp24648117p24705812.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Camel throughput issues...HTTP to AMQ

Posted by boday <bo...@vektrel.com>.
Thanks for the information.  This definitely makes me hesitant to continue
using Camel 1.6.X with SMX 3.X.  It sounds like there are various
performance issues that likely won't be resolved until I move to 2.X and SMX
4 (neither of which is released yet).  Any ETA on when both SMX 4 and Camel
2.0 will be production ready?    

I guess I'm back to using servicemix-eip, servicemix-jms and servicemix-http
components (painful in comparison to the Camel implementation).

>From a performance perspective.  I am seeing decent numbers routing from
HTTP to AMQ now (500+/sec), but as soon as I route through in either a
process() method or a JBI service, the throughput drops significantly
(~100/sec).  I'm going to rework my application to not use Camel at all to
see where I end up.

Anyone else have any comments on this?  Are others seeing better performance
using these components?

thanks...




-----
Ben - Senior Consultant

-- 
View this message in context: http://www.nabble.com/Camel-throughput-issues...HTTP-to-AMQ-tp24648117p24705812.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Camel throughput issues...HTTP to AMQ

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Jul 28, 2009 at 6:39 PM, boday<bo...@vektrel.com> wrote:
>
> I have tried setting maxMessagesPerTask=-1, concurrentConsumers=20,
> maxConcurrentConsumers=20, but I'm still not getting any better throughput.
> Any other ideas?
>
> Also, I can't find Camel 1.6.2 anywhere in the Maven repositories, it
> doesn't appear to have been released yet.  Also, any updates on when Camel
Camel 1.6.1 is the last release. You can grab 1.6.2-SNAPSHOT versions
from Apache maven repos
or build from the source.

A 1.6.2 release will be done in Q3.

If you want to keep track faster then you can also try the FUSE
versions of Camel that is released regularly.



> 2.0 will be available for use with SMX 3.3?  I've read about many
> performance improvements that I'd like to be able to take advantage of.
>
I dont know if SMX 3.x is going to upgrade to use Camel 2.x. I doubt that.
SMX 4.x is going to be upgraded to use Camel 2.0 in Q3 when Camel 2.0 is out.


> thanks again...
>
>
>
> -----
> Ben - Senior Consultant
>
> --
> View this message in context: http://www.nabble.com/Camel-throughput-issues...HTTP-to-AMQ-tp24648117p24703317.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Camel throughput issues...HTTP to AMQ

Posted by boday <bo...@vektrel.com>.
I have tried setting maxMessagesPerTask=-1, concurrentConsumers=20,
maxConcurrentConsumers=20, but I'm still not getting any better throughput. 
Any other ideas?

Also, I can't find Camel 1.6.2 anywhere in the Maven repositories, it
doesn't appear to have been released yet.  Also, any updates on when Camel
2.0 will be available for use with SMX 3.3?  I've read about many
performance improvements that I'd like to be able to take advantage of.

thanks again...



-----
Ben - Senior Consultant

-- 
View this message in context: http://www.nabble.com/Camel-throughput-issues...HTTP-to-AMQ-tp24648117p24703317.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Camel throughput issues...HTTP to AMQ

Posted by davsclaus <ci...@yahoo.dk>.


boday wrote:
> 
> Alright now that I'm getting better througput to my AMQ queue from HTTP
> (~600/second), the next bottleneck is in my process that parses the
> inbound message (simple Java XML parsing and validation) and publishes it
> to a topic.  
> 
>     	from("activemq:GatewayMsgQueue")
>     	.process(new MessageProcessor())
> 	.to("activemq:topic:PortalTopic");
> 
> Using a single queue consumer, the MessageProcessor is able to handle
> about 100 messages/second.  My GatewayMsgQueue simply backs up at the rate
> of about 500 msg/second.  
> 
> I thought that I simply needed to increase the number of concurrent
> consumers, but that hasn't seemed to make a difference in overall
> throughput either.  
> 
>     	from("activemq:GatewayMsgQueue?maxConcurrentConsumers=10")
>     	.process(new MessageProcessor())
> 	.to("activemq:topic:PortalTopic");
> 
> I also tried adding an explicit thread statement to help things along...is
> this any different?
> 
>     	from("activemq:GatewayMsgQueue")
>         .thread(10)
>     	.process(new MessageProcessor())
> 	.to("activemq:topic:PortalTopic");
> 
> No luck with either approach...my overall throughput remains the same. 
> Any other ideas what would make this route yield a higher throughput?  I'm
> working on a dual core CPU, I'd think the concurrent consumer approach
> would help a bit at least.
> 
> thanks
> 
> 
> 
> 
> 


The option is named: concurrentConsumers 
the max one will just be like an upper bounds. So use concurrentConsumers=10
to use 10 at the same time.

And also notice the bad defaults about maxMessagesPerTask that is displayed
on top of this page
http://camel.apache.org/jms.html
-- 
View this message in context: http://www.nabble.com/Camel-throughput-issues...HTTP-to-AMQ-tp24648117p24698014.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Camel throughput issues...HTTP to AMQ

Posted by boday <bo...@vektrel.com>.
Alright now that I'm getting better througput to my AMQ queue from HTTP
(~600/second), the next bottleneck is in my process that parses the inbound
message (simple Java XML parsing and validation) and publishes it to a
topic.  

    	from("activemq:GatewayMsgQueue")
    	.process(new MessageProcessor())
	.to("activemq:topic:PortalTopic");

Using a single queue consumer, the MessageProcessor is able to handle about
100 messages/second.  My GatewayMsgQueue simply backs up at the rate of
about 500 msg/second.  

I thought that I simply needed to increase the number of concurrent
consumers, but that hasn't seemed to make a difference in overall throughput
either.  

    	from("activemq:GatewayMsgQueue?maxConcurrentConsumers=10")
    	.process(new MessageProcessor())
	.to("activemq:topic:PortalTopic");

I also tried adding an explicit thread statement to help things along...is
this any different?

    	from("activemq:GatewayMsgQueue")
        .thread(10)
    	.process(new MessageProcessor())
	.to("activemq:topic:PortalTopic");

No luck with either approach...my overall throughput remains the same.  Any
other ideas what would make this route yield a higher throughput?  I'm
working on a dual core CPU, I'd think the concurrent consumer approach would
help a bit at least.

thanks





-----
Ben - Senior Consultant

-- 
View this message in context: http://www.nabble.com/Camel-throughput-issues...HTTP-to-AMQ-tp24648117p24690457.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Camel throughput issues...HTTP to AMQ

Posted by boday <bo...@vektrel.com>.
I have an update on this issue.  I tried using an annotated POJO approach
rather than just the from.("jetty:...").process(...).to("activemq:") method. 
For whatever reason, I'm now seeing closer to 600 msg/sec (up from
~150/sec).  Here is the code...

    @Produce(uri="activemq:GatewayMsgQueue")
    ProducerTemplate producer;
    
    @Consume(uri="jetty:http://0.0.0.0:9000/inboundMessage")
    public void onMessage(String msg) { 
	    //logger.debug("onMessage->" + msg);
	    producer.sendBody(msg);
    } 

Anyone know why this approach increased throughput so much?  I no longer
have to explicitly convert the inbound data using the process() step to get
it to AMQ...this approach must be doing that on its own.  If anyone knows
why this approach seems to be much more efficient, let me know.

thanks



-----
Ben - Senior Consultant

-- 
View this message in context: http://www.nabble.com/Camel-throughput-issues...HTTP-to-AMQ-tp24648117p24658972.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Camel throughput issues...HTTP to AMQ

Posted by davsclaus <ci...@yahoo.dk>.


boday wrote:
> 
> I'm using SMX 3.3.1 and Camel 1.6.1.  I have the following Camel route
> which simply takes inbound HTTP posts and sends them to an AMQ queue.  I
> was getting pretty good throughput (400+/sec) until I added the 3rd line
> to process the inbound data (seemed necessary to populate the AMQ message
> body correctly...not sure why though).  Now my throughput is cut to
> ~150/second.  
> 
> Any ideas why that would be?  I can't imagine the overhead of the
> processor is that much...but apparently this setup is causing some issues.
> 
> 	from("jetty:http://www.test.com")
> 	.inOnly()                                           //is this necessary?
> 	.process(new HTTPInboundService())     //slows things down considerable
> 	.to("activemq:GatewayMsgQueue");
> 
>   class HTTPInboundService implements Processor {
>         public void process(Exchange exchange) throws Exception {
>         	try {
>         	
> exchange.getOut().setBody(exchange.getIn().getBody(String.class));
>         	} catch (Exception e) {
>         		logger.error("HTTPInboundService.error->" + e.getMessage());
>         		throw e;
>         	}
>         }
>     }    
> 
> Along these lines, is there a better way to get high volume (400+ msg/sec)
> HTTP data into an AMQ queue (for downstream processing)?  I tried adding a
> seda queue in between the two...but the seda queue just filled up and
> errored out after a few minutes.  Its like AMQ can't keep up with the
> traffic...does this sound right?
> 
> 	        from("jetty:http://www.test.com")
> 		.inOnly()
> 		.to("seda:inbound?size=20000");
> 		
> 		from("seda:inbound?size=20000")
> 		.thread(100)
> 		.process(new HTTPInboundService())
> 		.to("activemq:GatewayMsgQueue");
> 
> thanks
> 
> 

You can do the inOnly when you send it to AMQ

from("jetty")
  .to().inOnly("activemq")

But you may need 1.6.2 as we have fixed some JMS related issue when doing
InOut and sending to a JMS destination using fire and forget (inOnly)
instead. Cant remember if that was fixed in 1.6.1 I doubt that.


-- 
View this message in context: http://www.nabble.com/Camel-throughput-issues...HTTP-to-AMQ-tp24648117p24698025.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.