开发者

Servicemix ActiveMQ performance issue

I am using apache servicemix and apache activeMQ in my product. Here in case of HttpConnector i found a performance issue.

If i increase number of total request at a time then as the number will increase exchange queue gets stuck on any of the component. After all the requests start processing, most of the exchange gets stuck at the end component or at the dispatcher* component. Container's heap size reaches to very hi开发者_如何学Cgh and after some time it crashes and restarts automatically.

I have used transactionmanager also. flowname is also mentioned as jms.

need some solution urgently.


You might try using KahaDB instead of the "amqPersistenceAdapter". We saw a huge throughput increase just by switching to this.

here is the config we used (which is highly dependent on your application, but make sure "enableJournalDiskSyncs" is set to false)

    <persistenceAdapter>
        <kahaDB directory="../data/kaha"
            enableJournalDiskSyncs="false"
            indexWriteBatchSize="10000"
            indexCacheSize="1000" />
    </persistenceAdapter>


If i increase number of total request at a time then as the number will increase exchange queue gets stuck on any of the component.

ActiveMQ has a mechanism to stop producer writing messages, it is called "flow controll", seems that you producer is faster than consumer (or consumer is not stable it its speed), so first check the memoryLimit config for your AMQ (also defining it or special queue possible). Try to increase it.

<destinationPolicy>
  <policyMap>
    <policyEntries>

      <policyEntry topic="FOO.>" producerFlowControl="false" memoryLimit="1mb">
        <dispatchPolicy>
          <strictOrderDispatchPolicy/>
        </dispatchPolicy>
        <subscriptionRecoveryPolicy>
          <lastImageSubscriptionRecoveryPolicy/>
        </subscriptionRecoveryPolicy>
      </policyEntry>

    </policyEntries>
  </policyMap>

Also, you can disable that stopping of processing incoming messages with producerFlowControl="false" option. So, in case when all buffer will be used, AMQ will slow down and all messages will be stored to HD. More info Producer Flow Control and Message Cursors

Container's heap size reaches to very high and after some time it crashes and restarts automatically.

But anyway, it is just way of tunning of your app, it is not solution, because always you will have the case when some resources run out :)

You should limit the incoming requests or balance them f.e. using Pound

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜