[
https://issues.apache.org/jira/browse/CAMEL-4863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13180523#comment-13180523
]
Aaron Whiteside commented on CAMEL-4863:
----------------------------------------
IRC conversation #camel:
16:22 awon getting better performance using seda then with threads, any
ideas why
16:23 awon 600 requests/sec compared to 3000 requests/sec with 10 threads
16:54 awon anyone?
16:56 jamieg 600 r/s on one thread VS 300 r/s over ten threads?
16:57 awon <threads maxPoolSize="10" poolSize="10"> vs <to
uri="seda:test?concurrentConsumers=10> .... in another route <from
uri="seda:test?concurrentConsumers=10"> .. yadda
16:57 jamieg context switching, thread management, single threaded
performance tweaking of the JVM, optimization trade offs, lower level thread
management (OS), physical hardware (memory model, cores per socket), etc etc
16:57 awon same machine.
16:58 awon from looking at the code, both <threads> ThreadsDefinition.java
and SedaEndpoint they're both just wrappers for an ExecuterService
16:58 jamieg The above still applies -- i can see how a single thread can be
faster than multiple threads - the important thing is that the increased
threads do more work as a group
16:58 awon umm
16:58 awon I think you're missing what I am saying
16:59 jamieg i think i am
16:59 jamieg you see 600 requests/sec on one thread, 3000 requests/sec with
ten threads
16:59 awon using either <threads> or seda:test has the same request, the
Exchange being queued to a ExecutorService... a thread pool
16:59 awon no.
17:00 jamieg "600 requests/sec compared to 3000 requests/sec with 10 threads"
17:00 awon 600 requests/ a second on 10 threads using <threads> or
threads() in Java DSL vs, 3000 using seda endpoint
17:00 jamieg OOOggg
17:00 jamieg ooohh
17:00 jamieg sorry
17:00 awon *with 10 threads
17:00 awon heh
17:00 jamieg that makes a major difference
17:00 awon yeah
17:01 awon I can see from jconsole that the thread pool created by the
threads() isn't doing much work, they're all mostly idle
17:01 jamieg that is strange
17:01 awon and from jmx, TaskQueueSize is always 0 and sometimes 1
17:02 jamieg which version of Camel?
17:03 awon last drop of 2.9 snapshot
17:03 awon i should probably move to 2.9 final
17:03 awon but i suspect there's no difference
17:04 awon even if I set maxQueueSize="100" for threads() no difference
17:04 awon I have a feeling its using the SynchronousQueue
17:04 awon internally
17:05 awon since no more than 1 ever gets buffered up in the thread pool
17:07 jamieg hmm, somethings sounds really fishy in there... i would expect
the threads to all be trying to consume as fast as possible
17:07 jamieg no contention
17:10 awon yeah, i'm just about to debug the app.. will let you know more
in a min
17:14 awon jamieg: mm well it's not using a SynchronousQueue, it's using a
LinkedBlockingQueue, so that's not the problem
17:29 awon even with seda:blah?concurrentConsumers=10&size=1 I still get
2800 a second...
17:39 awon jamieg: I'll just open a bug.. for now the workaround is to use
the seda endpoint, but threads() is nicer syntactically
17:40 jamieg sounds like a plan
> Using <threads>/threads() is ALOT slower than using the seda:endpoint
> ---------------------------------------------------------------------
>
> Key: CAMEL-4863
> URL: https://issues.apache.org/jira/browse/CAMEL-4863
> Project: Camel
> Issue Type: Bug
> Components: camel-core
> Affects Versions: 2.9.0
> Environment: JBoss 7.1 CR1b
> Reporter: Aaron Whiteside
> Priority: Critical
> Labels: performance, seda, threading, threads
>
> Snippets from my routing file:
> {code:xml}
> <threads maxPoolSize="10" maxQueueSize="10">
> <to uri="jms:queue:testQueue?deliveryPersistent=true"/>
> </threads>
> {code}
> compared to:
> {code:xml}
> <to uri="seda:test?concurrentConsumers=10&size=10"/>
> {code}
> {code:xml}
> <from uri="seda:test?concurrentConsumers=10&size=10"/>
> <to uri="jms:queue:testQueue?deliveryPersistent=true"/>
> {code}
> Using <threads> I get about 600 requests/per second.
> Using seda endpoint I get about 3000 requests/per second.
> Looking at the thread pools created by Camel in jconsole: I can see that the
> one created by <threads> is mostly idle as compared to the one created by the
> seda endpoint which is always busy.
> Also in the MBean Camel creates for it's managed thread pools, for the
> ThreadPool created by <threads> the TaskQueueSize attribute is almost always
> 0 and never more than 1. This is in contrast to the TaskQueueSize attribute
> on ThreadPool created by the seda endpoint which is always 10 (the seda queue
> size, and obviously until all the tasks have completed).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira