-
1. Re: AciveMQ performance problem
davsclaus Nov 17, 2011 5:22 AM (in response to rchallapalli)Are you using persistent messages in your test? This is used by default by Camel.
What does your Camel route look like?
And what versions of AMQ, Camel and SMX are you using?
-
2. Re: AciveMQ performance problem
rchallapalli Nov 17, 2011 6:17 AM (in response to davsclaus)Hi Claus,
I am using apache-servicemix-4.4.1-fuse-01-06, camel 2.8.1, apache-activemq-5.5.0-fuse-00-27.
My messages are persistent and it is a key requirement... are persistant messages that slow.. tps dropped from >2k to 50.. and average time per message raised from around 80ms to 900ms post adding routing to queue?
Route:
Java DSL
from("jetty:http://10...../inbound").routeId("httpToInboundWithAck")
.log("received xml message")
.transform(body()).log("called transform")
.inOnly("activemq:inboundQueue")
.transform(simple("Message Ack"))
.log("done!");
}Some bits from blueprint.xml
Jetty:
<bean id="jetty" class="org.apache.camel.component.jetty.JettyHttpComponent">
<property name="minThreads" value="200"/>
<property name="maxThreads" value="300"/></bean>
camelContext:
<camelContext id="preack-camel-context" xmlns="http://camel.apache.org/schema/blueprint">
<routeBuilder ref="preAck.routeBuilder" /> *<!-- where preAck.routeBuilder ref the above Java DSL RouteBuilder impl -->*
<threadPoolProfile id="preackThreadPoolProfile" poolSize="128" defaultProfile="true" maxPoolSize="150" /></camelContext>
Activemq connection pooling:
<!--connection pooling start -->
<bean id="preackConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="${activemq.brokerUrl}" />
</bean>
<bean id="preackPooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory">
<property name="maxConnections" value="128" />
<property name="maximumActive" value="130" />
<property name="connectionFactory" ref="preackConnectionFactory" />
</bean>
<bean id="preackJMSConfig" class="org.apache.camel.component.jms.JmsConfiguration">
<property name="connectionFactory" ref="preackPooledConnectionFactory" />
<property name="transacted" value="false" />
<!-- <property name="concurrentConsumers" value="20" /> -->
</bean>
<!--connection pooling end -->
Thanks in advance,
ravi
Edited by: rchallapalli on Nov 17, 2011 11:16 AM
-
3. Re: AciveMQ performance problem
rchallapalli Nov 18, 2011 8:32 AM (in response to davsclaus)Tried all the optimizations still get the same performance. So this is what I can expect!
-
4. Re: AciveMQ performance problem
garytully Dec 5, 2011 8:58 AM (in response to rchallapalli)The limiting factor here should be disk speed. On each jms send transaction completion there is an fsync to disk to ensure the messages is safely on disk before the response to the commit goes back to the client.
You can check your disk speed using the DiskBenchmark. From the base directory of an installation run: java -classpath lib/kahadb-<version>.jar org.apache.kahadb.util.DiskBenchmark.
The tool will access a local file named disk-benchmark.dat with simple writes, writes followed by an fsync and reads, then report the results.
The Sync Writes number represents the max transaction/second possible on your hardware. It is possible to experiment with the block size --bs to get an optimum value and configure KahaDB accordingly through the journalMaxWriteBatchSize and indexWriteBatchSize.
More important though, is to introduce some parallel processing in to the broker transaction processing. In this way, multiple transaction completions can share the overhead for a single disk sync. This simplest way to achieve this is to create a duplicate route that uses a second jms endpoint (which insures the that the connection is not shared). You can continue to add duplicate routes to achieve the desired level of parallel transactions. In this way, you can maximize the throughput by sharing the disk latency across multiple users.
-
5. Re: AciveMQ performance problem
rchallapalli Dec 6, 2011 6:05 AM (in response to garytully)This is an awesome advise and really worked out for me. The disk on our windows environment was very poor. I ran the benchmark utility on the test env and another Solaris machine as you advised and the Solaris machine gave 20x better disk performance than the windows hardware we used.
Elated to know you.
Once again my sincere thanks to you.
Cheers,
ravi.
Edited by: rchallapalli on Dec 6, 2011 11:04 AM